audiobookshelf/server/finders/PodcastFinder.js

17 lines
514 B
JavaScript
Raw Normal View History

const Logger = require('../Logger')
const iTunes = require('../providers/iTunes')
class PodcastFinder {
constructor() {
this.iTunesApi = new iTunes()
}
async search(term, options = {}) {
if (!term) return null
Logger.debug(`[iTunes] Searching for podcast with term "${term}"`)
2022-03-07 02:02:06 +01:00
var results = await this.iTunesApi.searchPodcasts(term, options)
Logger.debug(`[iTunes] Podcast search for "${term}" returned ${results.length} results`)
return results
}
}
module.exports = PodcastFinder