diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d4e244..4b3a810 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,18 +7,28 @@ - Remove Config.options.useGroup, but the feature remains. - Bug fixes. -## Version 4.7.1 - - Fix crash on client when access to talkgroups is restricted with a password. +_v4.7.1_ -## Version 4.7.2 - - Fix Keypad beeps not working on iOS. - - Fix pause not going off due to the above bug. +- Fix crash on client when access to talkgroups is restricted with a password. -## Version 4.7.3 - - Fix websocket not connection on ssl. +_v4.7.2_ -## Version 4.7.4 - - Fix display width too wide when long talkgroup name. +- Fix Keypad beeps not working on iOS. +- Fix pause not going off due to the above bug. + +_v4.7.3_ + +- Fix websocket not connection on ssl. + +_v4.7.4_ + +- Fix display width too wide when long talkgroup name. + +_v4.7.5_ + +- Fix playback mode getting mixed up if clicking too fast on play. +- Fix side panels background color inheritance. +- Node modules update. # Version 4.6 diff --git a/client/package-lock.json b/client/package-lock.json index 4c783ff..9e5b0a7 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1,6 +1,6 @@ { "name": "rdio-scanner-client", - "version": "4.7.4", + "version": "4.7.5", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -243,9 +243,9 @@ } }, "@angular/cdk": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-10.2.2.tgz", - "integrity": "sha512-DVMnj7QY1prZblRjYfDeyEH79p1TDI0JGgg2D2BAWwzMoPKCgVCqy1uRuvi+WNhYoDR3QJJJ8tXLKucUoShuIw==", + "version": "10.2.3", + "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-10.2.3.tgz", + "integrity": "sha512-ne3uSnWLQyUfYQ32zTvDauudyPONRPPBSbdOzFSsvFQuPxUcMQ3mFHJuq2OXei47TfSatmmyuKSuw9EtmTRbQw==", "requires": { "parse5": "^5.0.0", "tslib": "^2.0.0" @@ -524,9 +524,9 @@ } }, "@angular/material": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/@angular/material/-/material-10.2.2.tgz", - "integrity": "sha512-xRt8FsjY/MdC/dMBhitCXmOfXo4uhzLZ+kBqkKwY8gBsJ7FjhJIPbe/kRPBuzvVkVphrEfi/pMeDOge8v5ETbA==", + "version": "10.2.3", + "resolved": "https://registry.npmjs.org/@angular/material/-/material-10.2.3.tgz", + "integrity": "sha512-xqMC1A/CVX7RESnVm5EcK46MVXe1ROSMOf1RBuUeS6K+fnvx8kUxwmUcSY3LNREvW5hncFup7+MxSPfeFxv71A==", "requires": { "tslib": "^2.0.0" } diff --git a/client/package.json b/client/package.json index 51b191d..6514e60 100644 --- a/client/package.json +++ b/client/package.json @@ -2,12 +2,12 @@ "author": "Chrystian Huot ", "dependencies": { "@angular/animations": "^10.1.3", - "@angular/cdk": "^10.2.2", + "@angular/cdk": "^10.2.3", "@angular/common": "~10.1.3", "@angular/compiler": "~10.1.3", "@angular/core": "~10.1.3", "@angular/forms": "~10.1.3", - "@angular/material": "^10.2.2", + "@angular/material": "^10.2.3", "@angular/platform-browser": "~10.1.3", "@angular/platform-browser-dynamic": "~10.1.3", "@angular/service-worker": "~10.1.3", @@ -32,5 +32,5 @@ "build": "ng build --base-href ./ --prod", "start": "ng serve" }, - "version": "4.7.4" + "version": "4.7.5" } diff --git a/client/src/app/components/rdio-scanner/main/main.component.ts b/client/src/app/components/rdio-scanner/main/main.component.ts index 593870f..92775e5 100644 --- a/client/src/app/components/rdio-scanner/main/main.component.ts +++ b/client/src/app/components/rdio-scanner/main/main.component.ts @@ -163,16 +163,9 @@ export class AppRdioScannerMainComponent implements OnDestroy, OnInit { this.authFocus(); } else { - if (this.playbackMode) { - this.appRdioScannerService.beep(RdioScannerBeepStyle.Deactivate); + this.appRdioScannerService.beep(this.livefeedOffline ? RdioScannerBeepStyle.Activate : RdioScannerBeepStyle.Deactivate); - this.appRdioScannerService.stopPlaybackMode(); - - } else { - this.appRdioScannerService.beep(this.livefeedOffline ? RdioScannerBeepStyle.Activate : RdioScannerBeepStyle.Deactivate); - - this.appRdioScannerService.livefeed(); - } + this.appRdioScannerService.livefeed(); this.updateDimmer(); } diff --git a/client/src/app/components/rdio-scanner/rdio-scanner.component.scss b/client/src/app/components/rdio-scanner/rdio-scanner.component.scss index 1efdcf2..36763b2 100644 --- a/client/src/app/components/rdio-scanner/rdio-scanner.component.scss +++ b/client/src/app/components/rdio-scanner/rdio-scanner.component.scss @@ -4,23 +4,23 @@ display: block; height: 100%; min-width: 320px; -} -.mat-sidenav { - background-color: inherit; - color: inherit; - width: 100%; -} + .mat-sidenav { + background-color: inherit; + color: inherit; + width: 100%; + } -.mat-sidenav-container { - background-color: inherit; - color: inherit; - height: inherit; -} + .mat-sidenav-container { + background-color: inherit; + color: inherit; + height: inherit; + } -.mat-sidenav-content { - align-items: center; - display: flex; - flex-direction: row; - justify-content: center; -} \ No newline at end of file + .mat-sidenav-content { + align-items: center; + display: flex; + flex-direction: row; + justify-content: center; + } +} diff --git a/client/src/app/components/rdio-scanner/rdio-scanner.service.ts b/client/src/app/components/rdio-scanner/rdio-scanner.service.ts index f7c3da5..43210e7 100644 --- a/client/src/app/components/rdio-scanner/rdio-scanner.service.ts +++ b/client/src/app/components/rdio-scanner/rdio-scanner.service.ts @@ -19,7 +19,7 @@ import { DOCUMENT } from '@angular/common'; import { EventEmitter, Inject, Injectable, OnDestroy } from '@angular/core'; -import { interval, timer } from 'rxjs'; +import { interval, Subscription, timer } from 'rxjs'; import { takeWhile } from 'rxjs/operators'; import { RdioScannerAvoidOptions, @@ -88,8 +88,9 @@ export class AppRdioScannerService implements OnDestroy { private livefeedPaused = false; private playbackList: RdioScannerPlaybackList | undefined; + private playbackPending: string | undefined; - private skipDelay = false; + private skipDelay: Subscription | undefined; private websocket: WebSocket | undefined; @@ -314,12 +315,15 @@ export class AppRdioScannerService implements OnDestroy { } } - livefeed(status: boolean = !(this.livefeedMode === RdioScannerLivefeedMode.Online)): void { - if (status) { + livefeed(): void { + if (this.livefeedMode === RdioScannerLivefeedMode.Offline) { this.startLivefeed(); - } else { + } else if (this.livefeedMode === RdioScannerLivefeedMode.Online) { this.stopLivefeed(); + + } else if (this.livefeedMode === RdioScannerLivefeedMode.Playback) { + this.stopPlaybackMode(); } } @@ -328,7 +332,15 @@ export class AppRdioScannerService implements OnDestroy { } loadAndPlay(id: string): void { - this.stop({ emit: false }); + if (this.skipDelay) { + this.skipDelay.unsubscribe(); + + this.skipDelay = undefined; + } + + this.playbackPending = id; + + this.stop(); if (this.livefeedMode === RdioScannerLivefeedMode.Offline) { this.livefeedMode = RdioScannerLivefeedMode.Playback; @@ -427,12 +439,17 @@ export class AppRdioScannerService implements OnDestroy { }); } - queue(call: RdioScannerCall): void { + queue(call: RdioScannerCall, options?: { priority?: boolean }): void { if (!call?.audio) { return; } - this.callQueue.push(call); + if (options?.priority) { + this.callQueue.unshift(call); + + } else { + this.callQueue.push(call); + } if (this.audioSource || this.call || this.livefeedPaused || this.skipDelay) { this.event.emit({ @@ -453,27 +470,26 @@ export class AppRdioScannerService implements OnDestroy { } skip(options?: { delay?: boolean }): void { + const play = () => { + if (this.livefeedMode === RdioScannerLivefeedMode.Playback) { + this.playbackNextCall(); + + } else { + this.play(); + } + }; + this.stop(); if (options?.delay) { - this.skipDelay = true; + this.skipDelay = timer(1000).subscribe(() => { + this.skipDelay = undefined; - timer(1000).subscribe(() => { - this.skipDelay = false; - - if (this.livefeedMode === RdioScannerLivefeedMode.Playback) { - this.playbackNextCall(); - - } else { - this.play(); - } + play(); }); - } else if (this.livefeedMode === RdioScannerLivefeedMode.Playback) { - this.playbackNextCall(); - } else { - this.play(); + play(); } } @@ -493,25 +509,18 @@ export class AppRdioScannerService implements OnDestroy { } if (typeof options?.emit !== 'boolean' || options.emit) { - if (this.livefeedMode === RdioScannerLivefeedMode.Playback) { - this.event.emit({ call: undefined }); - - } else { - this.event.emit({ call: undefined, queue: this.callQueue.length }); - } + this.event.emit({ call: this.call }); } } stopPlaybackMode(): void { - if (this.livefeedMode === RdioScannerLivefeedMode.Playback) { - this.livefeedMode = RdioScannerLivefeedMode.Offline; + this.livefeedMode = RdioScannerLivefeedMode.Offline; - this.cleanQueue(); + this.clearQueue(); - this.stop({ emit: false }); + this.event.emit({ livefeedMode: this.livefeedMode, queue: 0 }); - this.event.emit({ call: this.call, livefeedMode: this.livefeedMode, queue: this.callQueue.length }); - } + this.stop(); } toggleGroup(label: string): void { @@ -609,22 +618,21 @@ export class AppRdioScannerService implements OnDestroy { } private cleanQueue(): void { - if (this.livefeedMode === RdioScannerLivefeedMode.Playback) { - this.callQueue.splice(0, this.callQueue.length); + this.callQueue = this.callQueue.filter((call: RdioScannerCall) => { + return this.livefeedMap && this.livefeedMap[call.system] && this.livefeedMap[call.system][call.talkgroup]; + }); - } else { - this.callQueue = this.callQueue.filter((call: RdioScannerCall) => { - return this.livefeedMap && this.livefeedMap[call.system] && this.livefeedMap[call.system][call.talkgroup]; - }); + if (this.call && !(this.livefeedMap && this.livefeedMap[this.call.system] && + this.livefeedMap[this.call.system][this.call.talkgroup])) { - if (this.call && !(this.livefeedMap && this.livefeedMap[this.call.system] && - this.livefeedMap[this.call.system][this.call.talkgroup])) { - - this.skip(); - } + this.skip(); } } + private clearQueue(): void { + this.callQueue.splice(0, this.callQueue.length); + } + private closeWebsocket(): void { if (this.websocket instanceof WebSocket) { this.websocket.onclose = null; @@ -719,6 +727,11 @@ export class AppRdioScannerService implements OnDestroy { if (message[2] === WebsocketCallFlag.Download) { this.download(message[1]); + } else if (message[2] === WebsocketCallFlag.Play && message[1]?.id === this.playbackPending) { + this.playbackPending = undefined; + + this.queue(this.transformCall(message[1]), { priority: true }); + } else { this.queue(this.transformCall(message[1])); } @@ -777,7 +790,7 @@ export class AppRdioScannerService implements OnDestroy { } private playbackNextCall(): void { - if (this.call || !this.playbackList || this.livefeedMode !== RdioScannerLivefeedMode.Playback) { + if (this.call || this.livefeedMode !== RdioScannerLivefeedMode.Playback || !this.playbackList || this.playbackPending) { return; } @@ -903,7 +916,7 @@ export class AppRdioScannerService implements OnDestroy { private stopLivefeed(): void { this.livefeedMode = RdioScannerLivefeedMode.Offline; - this.callQueue.splice(0, this.callQueue.length); + this.clearQueue(); this.event.emit({ livefeedMode: this.livefeedMode, queue: 0 }); diff --git a/client/src/app/components/rdio-scanner/search/search.component.ts b/client/src/app/components/rdio-scanner/search/search.component.ts index 556357c..1225962 100644 --- a/client/src/app/components/rdio-scanner/search/search.component.ts +++ b/client/src/app/components/rdio-scanner/search/search.component.ts @@ -89,11 +89,11 @@ export class AppRdioScannerSearchComponent implements OnDestroy { } formChangeHandler(): void { - if (this.livefeedPlayback) { - this.appRdioScannerService.stopPlaybackMode(); - } + if (this.livefeedPlayback) { + this.appRdioScannerService.stopPlaybackMode(); + } - this.searchCalls(); + this.searchCalls(); } formGroupHandler(): void { @@ -424,11 +424,11 @@ export class AppRdioScannerSearchComponent implements OnDestroy { } stop(): void { - if (this.livefeedOnline) { - this.appRdioScannerService.stop(); - - } else if (this.livefeedPlayback) { + if (this.livefeedPlayback) { this.appRdioScannerService.stopPlaybackMode(); + + } else { + this.appRdioScannerService.stop(); } } diff --git a/package.json b/package.json index ae3e356..8d3ee4c 100644 --- a/package.json +++ b/package.json @@ -11,5 +11,5 @@ "start": "node run", "update": "node update" }, - "version": "4.7.4" + "version": "4.7.5" } diff --git a/server/package-lock.json b/server/package-lock.json index 223503b..d97bc83 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -1,6 +1,6 @@ { "name": "rdio-scanner-server", - "version": "4.7.4", + "version": "4.7.5", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -702,6 +702,16 @@ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==" }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "block-stream": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", @@ -1855,9 +1865,9 @@ "dev": true }, "eslint": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.9.0.tgz", - "integrity": "sha512-V6QyhX21+uXp4T+3nrNfI3hQNBDa/P8ga7LoQOenwrlEFXrEnUEE+ok1dMtaS3b6rmLXhT1TkTIsG75HMLbknA==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.10.0.tgz", + "integrity": "sha512-BDVffmqWl7JJXqCjAK6lWtcQThZB/aP1HXSH1JKwGwv0LQEdvpR7qzNrUT487RM39B5goWuboFad5ovMBmD8yA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -1868,7 +1878,7 @@ "debug": "^4.0.1", "doctrine": "^3.0.0", "enquirer": "^2.3.5", - "eslint-scope": "^5.1.0", + "eslint-scope": "^5.1.1", "eslint-utils": "^2.1.0", "eslint-visitor-keys": "^1.3.0", "espree": "^7.3.0", @@ -2287,6 +2297,13 @@ "flat-cache": "^2.0.1" } }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -3854,6 +3871,13 @@ } } }, + "nan": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", + "dev": true, + "optional": true + }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -6369,7 +6393,11 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, - "optional": true + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } }, "glob-parent": { "version": "3.1.0", diff --git a/server/package.json b/server/package.json index 8796c7b..9f6ae95 100644 --- a/server/package.json +++ b/server/package.json @@ -20,7 +20,7 @@ "ws": "^7.3.1" }, "devDependencies": { - "eslint": "^7.9.0", + "eslint": "^7.10.0", "webpack": "^4.44.2", "webpack-cli": "^3.3.12", "webpack-node-externals": "^2.5.2" @@ -39,5 +39,5 @@ "build": "webpack", "start": "nodemon" }, - "version": "4.7.4" + "version": "4.7.5" }