···10111011 } = {},
10121012 } = this.config;
1013101310141014- // can't have negative retries!
10151015- const maxRetries = Math.max(0, maxRequestRetries);
10161016-10171014 if(this.scrobbling === true) {
10181015 this.logger.warn(`Already scrobble processing! Processing needs to be stopped before it can be started`);
10191016 return;
10201017 }
10181018+10191019+ // can't have negative retries!
10201020+ const maxRetries = Math.max(0, maxRequestRetries);
1021102110221022 while (this.scrobbleRetries <= maxRetries) {
10231023 try {
···10301030 this.logger.warn('Stopping scrobble processing due to client no longer usable.');
10311031 await this.notify({title: `Processing Error`, message: `Encountered error while scrobble processing and client is no longer usable, stopping processing!. | Error: ${e.message}`, priority: 'error'});
10321032 throw e;
10331033- } else if (this.authGated()) {
10331033+ }
10341034+ if (this.authGated()) {
10341035 this.logger.warn('Stopping scrobble processing due to client no longer being authenticated.');
10351036 await this.notify({title: ` Processing Error`, message: `Encountered error while scrobble processing and client is no longer authenticated, stopping processing!. | Error: ${e.message}`, priority: 'error'});
10361037 throw e;
10371037- } else if (this.scrobbleRetries < maxRetries) {
10381038+ }
10391039+ if (this.scrobbleRetries < maxRetries) {
10381040 const delayFor = pollingBackoff(this.scrobbleRetries + 1, retryMultiplier);
10391041 this.logger.info(`Scrobble processing retries (${this.scrobbleRetries}) less than max processing retries (${maxRetries}), restarting processing after ${delayFor} second delay...`);
10401042 await this.notify({title: `Processing Retry`, message: `Encountered error while polling but retries (${this.scrobbleRetries}) are less than max poll retries (${maxRetries}), restarting processing after ${delayFor} second delay. | Error: ${e.message}`, priority: 'warn'});
···12941296 if (processable === 0) {
12951297 this.deadLogger.verbose(queueStatus);
12961298 return;
12971297- } else {
12981298- this.setStatus(`Processing ${processable} Dead Plays`);
12991299 }
13001300+ this.setStatus(`Processing ${processable} Dead Plays`);
13001301 this.logger.info(queueStatus);
13011302 if(!this.upstreamRefresh.refreshEnabled) {
13021303 this.deadLogger.verbose('Scrobble refresh is DISABLED. All dead scrobbles will likely always be scrobbled (nothing to check duplicates against).');
···14561457 // return;
14571458 // }
14581459 const deadQueueState = deadScrobble.queueStates.find(x => x.queueName === CLIENT_DEAD_QUEUE && x.queueStatus !== 'completed');
14591459- const isQueued = deadQueueState.queueStatus === 'queued';
14601460 if(deadQueueState === undefined) {
14611461 throw new Error(`Play ${deadScrobble.uid} is not currently queued in dead letter.`);
14621462 }
14631463+ const isQueued = deadQueueState.queueStatus === 'queued';
14631464 //this.deadLetterScrobbles.splice(index, 1);
14641465 this.deadLetterGauge.labels(this.getPrometheusLabels()).dec();
14651466 const queueUpdate: Partial<QueueStateNew> = {
···17231724 if(npUpdateTopReason === 'previous update data matches current') {
17241725 if(thresholds.maxMet) {
17251726 return [true, `previous matches current update --AND-- ${thresholds.maxReason}`];
17261726- } else {
17271727- return [false, `previous matches current update --BUT-- ${thresholds.maxReason}`];
17281727 }
17281728+ return [false, `previous matches current update --BUT-- ${thresholds.maxReason}`];
17291729 }
1730173017311731 return [false, npUpdateTopReason];
···17491749 if (!thresholds.minMet) {
17501750 return [false, `${npUpdateTopReason} and ${validStatusReason} --BUT-- ${thresholds.minReason}`];
17511751 }
17521752- else if (
17521752+ if (
17531753 // status hasn't changed
17541754 this.nowPlayingLastPlay.status?.calculated === sourcePlayerData.status?.calculated
17551755 // and both plays are defined and have not changed
+11-11
src/backend/utils/FSUtils.ts
···5151 } catch (accessError: any) {
5252 if (accessError.code === 'EACCES') {
5353 // also can't access directory :(
5454- throw new Error(`No ${isDir ? 'directory' : 'file'} exists at ${location} and application does not have permission to write to the parent directory`);
5555- } else {
5656- throw new Error(`No ${isDir ? 'directory' : 'file'} exists at ${location} and application is unable to access the parent directory due to a system error`, { cause: accessError });
5454+ throw new Error(`No ${isDir ? 'directory' : 'file'} exists at ${location} and application does not have permission to write to the parent directory`,{cause: accessError});
5755 }
5656+5757+ throw new Error(`No ${isDir ? 'directory' : 'file'} exists at ${location} and application is unable to access the parent directory due to a system error`, { cause: accessError });
5858 }
5959- } else if (code === 'EACCES') {
6060- throw new Error(`${isDir ? 'Directory' : 'File'} exists at ${location} but application does not have permission to write to it.`);
6161- } else {
6262- throw new Error(`${isDir ? 'Directory' : 'File'} exists at ${location} but application is unable to access it due to a system error`, { cause: err });
6359 }
6060+ if (code === 'EACCES') {
6161+ throw new Error(`${isDir ? 'Directory' : 'File'} exists at ${location} but application does not have permission to write to it.`,{cause: err});
6262+ }
6363+ throw new Error(`${isDir ? 'Directory' : 'File'} exists at ${location} but application is unable to access it due to a system error`, { cause: err });
6464 }
6565};
6666···7474 const { code } = err;
7575 if (code === 'ENOENT') {
7676 return false;
7777- } else if (code === 'EACCES') {
7878- throw new Error(`${isDir ? 'Directory' : 'File'} exists at ${location} but application does not have permission to write to it.`);
7979- } else {
8080- throw new Error(`${isDir ? 'Directory' : 'File'} exists at ${location} but application is unable to access it due to a system error`, { cause: err });
8177 }
7878+ if (code === 'EACCES') {
7979+ throw new Error(`${isDir ? 'Directory' : 'File'} exists at ${location} but application does not have permission to write to it.`, {cause: err});
8080+ }
8181+ throw new Error(`${isDir ? 'Directory' : 'File'} exists at ${location} but application is unable to access it due to a system error`, { cause: err });
8282 }
8383};