[READ-ONLY] Mirror of https://github.com/FoxxMD/multi-scrobbler. Scrobble plays from multiple sources to multiple clients docs.multi-scrobbler.app
deezer docker jellyfin koito lastfm listenbrainz maloja mopidy mpris music music-assistant plex scrobble self-hosted spotify subsonic tautulli youtube-music
0

Configure Feed

Select the types of activity you want to include in your feed.

refactor(config)!: Move source retry config to options

FoxxMD (May 10, 2024, 12:07 PM EDT) ab372b83 c79f0458

+19 -15
+4 -4
config/config.json.example
··· 2 2 "debugMode": false, 3 3 "disableWeb": false, 4 4 "sourceDefaults": { 5 - "maxPollRetries": 1, 6 - "maxRequestRetries": 1, 7 - "retryMultiplier": 1.5, 8 5 "options": { 9 6 "logPayload": false, 10 7 "logFilterFailure": "warn", ··· 12 9 "scrobbleThresholds": { 13 10 "duration": 30, 14 11 "percent": 50 15 - } 12 + }, 13 + "maxPollRetries": 1, 14 + "maxRequestRetries": 1, 15 + "retryMultiplier": 1.5 16 16 } 17 17 }, 18 18 "clientDefaults": {
+2 -2
src/backend/common/infrastructure/config/source/index.ts
··· 39 39 percent?: number | null 40 40 } 41 41 42 - export interface CommonSourceOptions { 42 + export interface CommonSourceOptions extends SourceRetryOptions { 43 43 /** 44 44 * If this source has INGRESS to MS (sends a payload, rather than MS GETTING requesting a payload) 45 45 * then setting this option to true will make MS log the payload JSON to DEBUG output ··· 90 90 scrobbleThresholds?: ScrobbleThresholds 91 91 } 92 92 93 - export interface CommonSourceData extends CommonData, SourceRetryOptions { 93 + export interface CommonSourceData extends CommonData { 94 94 95 95 } 96 96
+2 -2
src/backend/sources/AbstractSource.ts
··· 397 397 this.pollRetries = 0; 398 398 399 399 const { 400 - data: { 400 + options: { 401 401 maxPollRetries = 5, 402 402 retryMultiplier = DEFAULT_RETRY_MULTIPLIER, 403 - } = {}, 403 + } 404 404 } = this.config; 405 405 406 406 // can't have negative retries!
+1 -1
src/backend/sources/DeezerSource.ts
··· 142 142 const { 143 143 maxRequestRetries = 1, 144 144 retryMultiplier = DEFAULT_RETRY_MULTIPLIER 145 - } = this.config.data; 145 + } = this.config.options; 146 146 147 147 req.query({ 148 148 access_token: this.config.data.accessToken,
+1 -1
src/backend/sources/SpotifySource.ts
··· 414 414 const { 415 415 maxRequestRetries = 1, 416 416 retryMultiplier = 2, 417 - } = this.config.data; 417 + } = this.config.options; 418 418 try { 419 419 return await func(this.spotifyApi); 420 420 } catch (e) {
+9 -5
src/backend/sources/SubsonicSource.ts
··· 70 70 71 71 callApi = async <T extends SubsonicResponseCommon = SubsonicResponseCommon>(req: Request, retries = 0): Promise<T> => { 72 72 const { 73 - user, 74 - password, 75 - maxRequestRetries = 1, 76 - retryMultiplier = DEFAULT_RETRY_MULTIPLIER 77 - } = this.config.data; 73 + data: { 74 + user, 75 + password 76 + } = {}, 77 + options: { 78 + maxRequestRetries = 1, 79 + retryMultiplier = DEFAULT_RETRY_MULTIPLIER 80 + } = {}, 81 + } = this.config; 78 82 79 83 const queryOpts: Record<string, string> = { 80 84 u: user,