From 8c402238edcd7040742d17a74741f810b2fdf175 Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Fri, 12 Jan 2024 11:38:52 -0500 Subject: [PATCH] feat(chrome): Add user debugging --- docsite/docs/FAQ.md | 6 ++++++ docsite/docs/configuration/configuration.md | 24 ++++++++++++++++++++- src/backend/sources/ChromecastSource.ts | 4 ++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/docsite/docs/FAQ.md b/docsite/docs/FAQ.md index 0ef9deb0..9b80cacc 100644 --- a/docsite/docs/FAQ.md +++ b/docsite/docs/FAQ.md @@ -151,3 +151,9 @@ Multi-scrobbler works the same was the official Spotify-Last.fm integration work ## Jellyfin does not scrobble tracks with multiple artists correctly This is a limitation caused by the [Jellyfin webhook plugin](https://github.com/FoxxMD/multi-scrobbler/issues/70#issuecomment-1443804712) only sending the first artist to multi-scrobbler. This issues needs to be [fixed upstream on the Jellyfin webhook repository.](https://github.com/jellyfin/jellyfin-plugin-webhook/issues/166) + +## Chromecast track information is missing/incorrect or MS player has weird times + +The Chromecast integration relies on a few common fields in the data it receives from your casting device. Every platform that can cast (Spotify, Pandora, etc...) *should* use these fields the same but there are slight differences between their implementations that may confuse multi-scrobbler. Specific platforms may also return more information in non-common fields that are undocumented. + +To diagnose these issues you [**must enable payload logging**](configuration/configuration.md#cast-troubleshooting) for your chromecast Source, run MS, and then include logs with this output from that run. Without the raw data logged from your cast device it will be nearly impossible to resolve your issue. diff --git a/docsite/docs/configuration/configuration.md b/docsite/docs/configuration/configuration.md index 4a0a5a47..bc0d2690 100644 --- a/docsite/docs/configuration/configuration.md +++ b/docsite/docs/configuration/configuration.md @@ -25,7 +25,7 @@ title: Overview * [JRiver](#jriver) * [Kodi](#kodi) * [WebScrobbler](#webscrobbler) - * [Google Cast (Chromecast)](#google-cast--chromecast-) + * [Google Cast (Chromecast)](#google-cast--chromecast) * [Client Configurations](#client-configurations) * [Maloja](#maloja) * [Last.fm](#lastfm) @@ -703,6 +703,28 @@ If your media device can be **Cast** to using this button ![Chromecast Icon](htt The machine and/or container running multi-scrobbler must be configured to allow [mDNS traffic on port 5353/UDP](https://book.hacktricks.xyz/network-services-pentesting/5353-udp-multicast-dns-mdns). +#### Cast Troubleshooting + +Please include any/all logs with raw output if there are any errors encountered as this is critical to diagnosing issues. + +To diagnose bad/incomplete track information or strange MS player behavior please turn on **payload logging** and include log output of the source running to help diagnose this issue: + +```json5 +// in chromecast.json or config.json sources +[ + { + "name": "MyCast", + "type": "chromecast", + "data": { + //... + }, + "options": { + "logPayload": true + } + } +] +``` + ### ENV-Based | Environmental Variable | Required? | Default | Description | diff --git a/src/backend/sources/ChromecastSource.ts b/src/backend/sources/ChromecastSource.ts index 309bde69..fb9834e6 100644 --- a/src/backend/sources/ChromecastSource.ts +++ b/src/backend/sources/ChromecastSource.ts @@ -329,6 +329,10 @@ export class ChromecastSource extends MemorySource { } } + if(this.config.options.logPayload) { + this.logger.debug(`Media Status Payload:\n ${JSON.stringify(mediaStatus)}`); + } + const play = ChromecastSource.formatPlayObj(mediaStatus, { deviceId: genDeviceId(k, application.displayName), source: application.displayName