[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(chrome): Use forked chromecast-client lib

* Instead of patching using forked lib with validation fixes and improvements
* Print raw data if validation error is found

FoxxMD (Jan 12, 2024, 11:12 AM EST) 758770d2 ee7ebb15

+29 -6
+17 -4
package-lock.json
··· 24 24 "better-sse": "^0.8.0", 25 25 "body-parser": "^1.19.0", 26 26 "bonjour-service": "^1.2.1", 27 - "chromecast-client": "^1.0.1", 27 + "castv2": "^0.1.10", 28 + "chromecast-client": "github:foxxmd/chromecast-client#dist", 28 29 "clsx": "^2.0.0", 29 30 "common-tags": "^1.8.2", 30 31 "compare-versions": "^4.1.2", ··· 7516 7517 }, 7517 7518 "node_modules/chromecast-client": { 7518 7519 "version": "1.0.1", 7519 - "resolved": "https://registry.npmjs.org/chromecast-client/-/chromecast-client-1.0.1.tgz", 7520 - "integrity": "sha512-79QTIu6g1oYHvI9i8sPc8kpwrZGb6hXiNnEJmoiFLfjTYTJO+kKc8ML1uqNNKZbKMMFsgR/89da0A3ezD5p92A==", 7520 + "resolved": "git+ssh://git@github.com/foxxmd/chromecast-client.git#e65837e350bea9ef6f85a9e536b1a351b753076a", 7521 + "license": "MIT", 7521 7522 "dependencies": { 7522 7523 "castv2": "^0.1.10", 7523 7524 "debug": "^4.3.4", 7524 - "zod": "^3.20.2" 7525 + "zod": "^3.20.2", 7526 + "zod-validation-error": "^2.1.0" 7525 7527 }, 7526 7528 "funding": { 7527 7529 "url": "https://www.patreon.com/dantaylor" ··· 25854 25856 "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", 25855 25857 "funding": { 25856 25858 "url": "https://github.com/sponsors/colinhacks" 25859 + } 25860 + }, 25861 + "node_modules/zod-validation-error": { 25862 + "version": "2.1.0", 25863 + "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-2.1.0.tgz", 25864 + "integrity": "sha512-VJh93e2wb4c3tWtGgTa0OF/dTt/zoPCPzXq4V11ZjxmEAFaPi/Zss1xIZdEB5RD8GD00U0/iVXgqkF77RV7pdQ==", 25865 + "engines": { 25866 + "node": ">=18.0.0" 25867 + }, 25868 + "peerDependencies": { 25869 + "zod": "^3.18.0" 25857 25870 } 25858 25871 } 25859 25872 }
+2 -1
package.json
··· 62 62 "better-sse": "^0.8.0", 63 63 "body-parser": "^1.19.0", 64 64 "bonjour-service": "^1.2.1", 65 - "chromecast-client": "^1.0.1", 65 + "castv2": "^0.1.10", 66 + "chromecast-client": "github:foxxmd/chromecast-client#dist", 66 67 "clsx": "^2.0.0", 67 68 "common-tags": "^1.8.2", 68 69 "compare-versions": "^4.1.2",
patches/chromecast-client+1.0.1.patch patches/chromecast-client+1.0.1.patch.maybeUse
+10 -1
src/backend/sources/ChromecastSource.ts
··· 10 10 import Bonjour, {Service} from "bonjour-service"; 11 11 import {MediaController, PersistentClient, Media} from "chromecast-client"; 12 12 import {Client as CastClient} from 'castv2'; 13 - import {ErrorWithCause} from "pony-cause"; 13 + import {ErrorWithCause, findCauseByReference} from "pony-cause"; 14 14 import {PlayObject} from "../../core/Atomic"; 15 15 import dayjs from "dayjs"; 16 16 import {RecentlyPlayedOptions} from "./AbstractSource"; ··· 26 26 initializeClientPlatform 27 27 } from "../common/vendor/chromecast/ChromecastClientUtils"; 28 28 import {Logger} from "@foxxmd/winston"; 29 + import {ContextualValidationError} from "chromecast-client/dist/cjs/src/utils"; 29 30 30 31 interface ChromecastDeviceInfo { 31 32 mdns: Service ··· 180 181 apps = await getCurrentPlatformApplications(v.platform); 181 182 } catch (e) { 182 183 v.logger.warn(new ErrorWithCause('Could not refresh applications', {cause: e})); 184 + const validationError = findCauseByReference(e, ContextualValidationError); 185 + if(validationError && validationError.data !== undefined) { 186 + v.logger.warn(JSON.stringify(validationError.data)); 187 + } 183 188 continue; 184 189 } 185 190 ··· 339 344 } 340 345 } catch (e) { 341 346 this.logger.warn(new ErrorWithCause(`Could not get Player State for ${k}`, {cause: e})) 347 + const validationError = findCauseByReference(e, ContextualValidationError); 348 + if(validationError && validationError.data !== undefined) { 349 + v.logger.warn(JSON.stringify(validationError.data)); 350 + } 342 351 } 343 352 } 344 353