mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-23 04:09:38 +00:00
增加播客搜索地区配置
This commit is contained in:
parent
9f909b0d85
commit
56eff7a236
21 changed files with 36 additions and 1 deletions
|
|
@ -48,6 +48,7 @@ class ServerSettings {
|
|||
this.dateFormat = 'MM/dd/yyyy'
|
||||
this.timeFormat = 'HH:mm'
|
||||
this.language = 'en-us'
|
||||
this.podcastSearchRegion = 'us'
|
||||
|
||||
this.logLevel = Logger.logLevel
|
||||
|
||||
|
|
@ -109,6 +110,7 @@ class ServerSettings {
|
|||
this.dateFormat = settings.dateFormat || 'MM/dd/yyyy'
|
||||
this.timeFormat = settings.timeFormat || 'HH:mm'
|
||||
this.language = settings.language || 'en-us'
|
||||
this.podcastSearchRegion = settings.podcastSearchRegion || 'us'
|
||||
this.logLevel = settings.logLevel || Logger.logLevel
|
||||
this.version = settings.version || null
|
||||
this.buildNumber = settings.buildNumber || 0 // Added v2.4.5
|
||||
|
|
@ -198,6 +200,7 @@ class ServerSettings {
|
|||
dateFormat: this.dateFormat,
|
||||
timeFormat: this.timeFormat,
|
||||
language: this.language,
|
||||
podcastSearchRegion: this.podcastSearchRegion,
|
||||
logLevel: this.logLevel,
|
||||
version: this.version,
|
||||
buildNumber: this.buildNumber,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
const axios = require('axios')
|
||||
const Logger = require('../Logger')
|
||||
const htmlSanitizer = require('../utils/htmlSanitizer')
|
||||
const Database = require('../Database')
|
||||
|
||||
class iTunes {
|
||||
constructor() { }
|
||||
|
|
@ -17,7 +18,7 @@ class iTunes {
|
|||
entity: options.entity,
|
||||
lang: options.lang,
|
||||
limit: options.limit,
|
||||
country: options.country
|
||||
country: options.country ? options.country : Database.serverSettings.podcastSearchRegion
|
||||
}
|
||||
return axios.get('https://itunes.apple.com/search', { params: query }).then((response) => {
|
||||
return response.data.results || []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue