mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Merge pull request #2733 from kaldigo/master
Added isbn to CustomProviderAdapter
This commit is contained in:
		
						commit
						2584c3b432
					
				@ -152,11 +152,12 @@ class BookFinder {
 | 
			
		||||
  /**
 | 
			
		||||
   * 
 | 
			
		||||
   * @param {string} title 
 | 
			
		||||
   * @param {string} author 
 | 
			
		||||
   * @param {string} author
 | 
			
		||||
   * @param {string} isbn 
 | 
			
		||||
   * @param {string} providerSlug 
 | 
			
		||||
   * @returns {Promise<Object[]>}
 | 
			
		||||
   */
 | 
			
		||||
  async getCustomProviderResults(title, author, providerSlug) {
 | 
			
		||||
  async getCustomProviderResults(title, author, isbn, providerSlug) {
 | 
			
		||||
    const books = await this.customProviderAdapter.search(title, author, providerSlug, 'book')
 | 
			
		||||
    if (this.verbose) Logger.debug(`Custom provider '${providerSlug}' Search Results: ${books.length || 0}`)
 | 
			
		||||
 | 
			
		||||
@ -333,7 +334,7 @@ class BookFinder {
 | 
			
		||||
 | 
			
		||||
    // Custom providers are assumed to be correct
 | 
			
		||||
    if (provider.startsWith('custom-')) {
 | 
			
		||||
      return this.getCustomProviderResults(title, author, provider)
 | 
			
		||||
      return this.getCustomProviderResults(title, author, isbn, provider)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!title)
 | 
			
		||||
 | 
			
		||||
@ -9,11 +9,12 @@ class CustomProviderAdapter {
 | 
			
		||||
     * 
 | 
			
		||||
     * @param {string} title 
 | 
			
		||||
     * @param {string} author 
 | 
			
		||||
     * @param {string} isbn 
 | 
			
		||||
     * @param {string} providerSlug 
 | 
			
		||||
     * @param {string} mediaType
 | 
			
		||||
     * @returns {Promise<Object[]>}
 | 
			
		||||
     */
 | 
			
		||||
    async search(title, author, providerSlug, mediaType) {
 | 
			
		||||
    async search(title, author, isbn, providerSlug, mediaType) {
 | 
			
		||||
        const providerId = providerSlug.split('custom-')[1]
 | 
			
		||||
        const provider = await Database.customMetadataProviderModel.findByPk(providerId)
 | 
			
		||||
 | 
			
		||||
@ -29,6 +30,9 @@ class CustomProviderAdapter {
 | 
			
		||||
        if (author) {
 | 
			
		||||
            queryObj.author = author
 | 
			
		||||
        }
 | 
			
		||||
        if (isbn) {
 | 
			
		||||
            queryObj.isbn = isbn
 | 
			
		||||
        }
 | 
			
		||||
        const queryString = (new URLSearchParams(queryObj)).toString()
 | 
			
		||||
 | 
			
		||||
        // Setup headers
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user