Merge branch 'advplyr:master' into ffmpeg-progress

This commit is contained in:
mikiher 2024-07-20 12:28:47 +03:00 committed by GitHub
commit 7faf42d892
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
44 changed files with 1146 additions and 541 deletions

View file

@ -81,6 +81,10 @@ function parseNfoMetadata(nfoText) {
case 'isbn-13':
metadata.isbn = value
break
case 'language':
case 'lang':
metadata.language = value
break
}
}
})

View file

@ -1,17 +1,21 @@
const h = require('htmlparser2')
const Logger = require('../../Logger')
/**
*
* @param {string} opmlText
* @returns {Array<{title: string, feedUrl: string}>
*/
function parse(opmlText) {
var feeds = []
var parser = new h.Parser({
onopentag: (name, attribs) => {
if (name === "outline" && attribs.type === 'rss') {
if (name === 'outline' && attribs.type === 'rss') {
if (!attribs.xmlurl) {
Logger.error('[parseOPML] Invalid opml outline tag has no xmlurl attribute')
} else {
feeds.push({
title: attribs.title || 'No Title',
text: attribs.text || '',
title: attribs.title || attribs.text || '',
feedUrl: attribs.xmlurl
})
}
@ -21,4 +25,4 @@ function parse(opmlText) {
parser.write(opmlText)
return feeds
}
module.exports.parse = parse
module.exports.parse = parse

View file

@ -289,7 +289,6 @@ module.exports.findMatchingEpisodesInFeed = (feed, searchTitle) => {
const matches = []
feed.episodes.forEach((ep) => {
if (!ep.title) return
const epTitle = ep.title.toLowerCase().trim()
if (epTitle === searchTitle) {
matches.push({