mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-04 03:51:53 +02:00
Update JSDocs & auto-formatting of PodcastFinder
This commit is contained in:
@@ -42,7 +42,7 @@ class SearchController {
|
|||||||
* Fetches a library item by ID
|
* Fetches a library item by ID
|
||||||
* @param {string} id - Library item ID
|
* @param {string} id - Library item ID
|
||||||
* @param {string} methodName - Name of the calling method for logging
|
* @param {string} methodName - Name of the calling method for logging
|
||||||
* @returns {Promise<LibraryItem>}
|
* @returns {Promise<import('../models/LibraryItem').LibraryItemExpanded>}
|
||||||
*/
|
*/
|
||||||
static async fetchLibraryItem(id) {
|
static async fetchLibraryItem(id) {
|
||||||
const libraryItem = await Database.libraryItemModel.getExpandedById(id)
|
const libraryItem = await Database.libraryItemModel.getExpandedById(id)
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ class PodcastFinder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {string} term
|
* @param {string} term
|
||||||
* @param {{country:string}} options
|
* @param {{country:string}} options
|
||||||
* @returns {Promise<import('../providers/iTunes').iTunesPodcastSearchResult[]>}
|
* @returns {Promise<import('../providers/iTunes').iTunesPodcastSearchResult[]>}
|
||||||
*/
|
*/
|
||||||
async search(term, options = {}) {
|
async search(term, options = {}) {
|
||||||
@@ -20,12 +20,16 @@ class PodcastFinder {
|
|||||||
return results
|
return results
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} term
|
||||||
|
* @returns {Promise<string[]>}
|
||||||
|
*/
|
||||||
async findCovers(term) {
|
async findCovers(term) {
|
||||||
if (!term) return null
|
if (!term) return null
|
||||||
Logger.debug(`[iTunes] Searching for podcast covers with term "${term}"`)
|
Logger.debug(`[iTunes] Searching for podcast covers with term "${term}"`)
|
||||||
var results = await this.iTunesApi.searchPodcasts(term)
|
const results = await this.iTunesApi.searchPodcasts(term)
|
||||||
if (!results) return []
|
if (!results) return []
|
||||||
return results.map(r => r.cover).filter(r => r)
|
return results.map((r) => r.cover).filter((r) => r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
module.exports = new PodcastFinder()
|
module.exports = new PodcastFinder()
|
||||||
|
|||||||
Reference in New Issue
Block a user