Skip to content

Commit 8929a63

Browse files
committed
docs: chromecast docs and schema
1 parent 077f5d7 commit 8929a63

File tree

7 files changed

+574
-0
lines changed

7 files changed

+574
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ A javascript app to scrobble music you listened to, to [Maloja](https://github.c
2323
* [Mopidy](/docsite/docs/configuration/configuration.md#mopidy)
2424
* [JRiver](/docsite/docs/configuration/configuration.md#jriver)
2525
* [Kodi](/docsite/docs/configuration/configuration.md#kodi)
26+
* [Google Cast (Chromecast)](/docsite/docs/configuration/configuration.md#google-cast--chromecast-)
2627
* Supports scrobbling to many **Clients**
2728
* [Maloja](/docsite/docs/configuration/configuration.md#maloja)
2829
* [Last.fm](/docsite/docs/configuration/configuration.md#lastfm)

config/chromecast.json.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[
2+
{
3+
"name": "MyCast",
4+
"data": {
5+
"blacklistedDevices": [],
6+
"whitelistedDevices": [],
7+
"blacklistedApps": [],
8+
"whitelistedApps": []
9+
}
10+
}
11+
]

docsite/docs/configuration/configuration.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ title: Overview
2525
* [JRiver](#jriver)
2626
* [Kodi](#kodi)
2727
* [WebScrobbler](#webscrobbler)
28+
* [Google Cast (Chromecast)](#google-cast--chromecast-)
2829
* [Client Configurations](#client-configurations)
2930
* [Maloja](#maloja)
3031
* [Last.fm](#lastfm)
@@ -694,6 +695,28 @@ MS can be configured to only scrobble, or NOT scrobble, from some WS connectors.
694695

695696
See [`webscrobbler.json.example`](https://github.com/FoxxMD/multi-scrobbler/blob/master/config/webscrobbler.json.example) or [explore the schema with an example and live editor/validator](https://json-schema.app/view/%23%2Fdefinitions%2FWebScrobblerSourceConfig/%23%2Fdefinitions%2FWebScrobblerData?url=https%3A%2F%2Fraw.githubusercontent.com%2FFoxxMD%2Fmulti-scrobbler%2Fmaster%2Fsrc%2Fbackend%2Fcommon%2Fschema%2Fsource.json)
696697

698+
## [Google Cast (Chromecast)](https://www.google.com/chromecast/built-in/)
699+
700+
If your media device can be **Cast** to using this button ![Chromecast Icon](https://upload.wikimedia.org/wikipedia/commons/2/26/Chromecast_cast_button_icon.svg) on your phone/computer then multi-scrobbler can monitor it in order to scrobble music you play.
701+
702+
**Note:** This source relies on common, **basic** music data provided by the cast device which will always be less exhaustive than data parsed from full source integrations. If there is an existing [Source](#source-configurations) it is recommended to configure for it and blacklist the app on Google Cast, rather than relying solely on Google Cast for scrobbling.
703+
704+
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).
705+
706+
### ENV-Based
707+
708+
| Environmental Variable | Required? | Default | Description |
709+
|------------------------|-----------|---------|--------------------------------------------------------------------------------------|
710+
| CC_ENABLE | No | | Set to 'true' to enable Cast monitoring without needing to define other ENVs |
711+
| CC_WHITELIST_DEVICES | No | | Only scrobble from these Cast devices. Comma-delimited list. EX mini-home, family-tv |
712+
| CC_BLACKLIST_DEVICES | No | | Do not scrobble from these Cast devices. Comma-delimited list |
713+
| CC_WHITELIST_APPS | No | | Only scrobble from these casted Apps. Comma-delimited list. EX spotify, pandora |
714+
| CC_BLACKLIST_APPS | No | | Do not scrobble from these casted Apps. Comma-delimited list |
715+
716+
### File-Based
717+
718+
See [`chromecast.json.example`](https://github.com/FoxxMD/multi-scrobbler/blob/master/config/webscrobbler.json.example) or [explore the schema with an example and live editor/validator](https://json-schema.app/view/%23%2Fdefinitions%2FChromecastSourceConfig/%23%2Fdefinitions%2FChromecastData?url=https%3A%2F%2Fraw.githubusercontent.com%2FFoxxMD%2Fmulti-scrobbler%2Fmaster%2Fsrc%2Fbackend%2Fcommon%2Fschema%2Fsource.json)
719+
697720
# Client Configurations
698721

699722
## [Maloja](https://github.com/krateng/maloja)

docsite/src/pages/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ A javascript app to scrobble music you listened to, to [Maloja](https://github.c
2626
* [Mopidy](docs/configuration#mopidy)
2727
* [JRiver](docs/configuration#jriver)
2828
* [Kodi](docs/configuration#kodi)
29+
* [Google Cast (Chromecast)](/docs/configuration#google-cast--chromecast-)
2930
* Supports scrobbling to many **Clients**
3031
* [Maloja](docs/configuration#maloja)
3132
* [Last.fm](docs/configuration#lastfm)

src/backend/common/schema/aio-source.json

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,185 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"definitions": {
4+
"ChromecastData": {
5+
"properties": {
6+
"blacklistApps": {
7+
"anyOf": [
8+
{
9+
"items": {
10+
"type": "string"
11+
},
12+
"type": "array"
13+
},
14+
{
15+
"type": "string"
16+
}
17+
],
18+
"description": "DO NOT scrobble from any application that START WITH these values, case-insensitive",
19+
"examples": [
20+
[
21+
"spotify",
22+
"pandora"
23+
]
24+
],
25+
"title": "blacklistApps"
26+
},
27+
"blacklistDevices": {
28+
"anyOf": [
29+
{
30+
"items": {
31+
"type": "string"
32+
},
33+
"type": "array"
34+
},
35+
{
36+
"type": "string"
37+
}
38+
],
39+
"description": "DO NOT scrobble from any cast devices that START WITH these values, case-insensitive",
40+
"examples": [
41+
[
42+
"home-mini",
43+
"family-tv"
44+
]
45+
],
46+
"title": "blacklistDevices"
47+
},
48+
"maxPollRetries": {
49+
"default": 5,
50+
"description": "default # of automatic polling restarts on error",
51+
"examples": [
52+
5
53+
],
54+
"title": "maxPollRetries",
55+
"type": "number"
56+
},
57+
"maxRequestRetries": {
58+
"default": 1,
59+
"description": "default # of http request retries a source can make before error is thrown",
60+
"examples": [
61+
1
62+
],
63+
"title": "maxRequestRetries",
64+
"type": "number"
65+
},
66+
"options": {
67+
"$ref": "#/definitions/Record<string,any>",
68+
"title": "options"
69+
},
70+
"retryMultiplier": {
71+
"default": 1.5,
72+
"description": "default retry delay multiplier (retry attempt * multiplier = # of seconds to wait before retrying)",
73+
"examples": [
74+
1.5
75+
],
76+
"title": "retryMultiplier",
77+
"type": "number"
78+
},
79+
"scrobbleThresholds": {
80+
"$ref": "#/definitions/ScrobbleThresholds",
81+
"description": "Set thresholds for when multi-scrobbler should consider a tracked play to be \"scrobbable\". If both duration and percent are defined then if either condition is met the track is scrobbled.",
82+
"title": "scrobbleThresholds"
83+
},
84+
"whitelistApps": {
85+
"anyOf": [
86+
{
87+
"items": {
88+
"type": "string"
89+
},
90+
"type": "array"
91+
},
92+
{
93+
"type": "string"
94+
}
95+
],
96+
"description": "ONLY scrobble from any application that START WITH these values, case-insensitive\n\nIf whitelist is present then blacklist is ignored",
97+
"examples": [
98+
[
99+
"spotify",
100+
"pandora"
101+
]
102+
],
103+
"title": "whitelistApps"
104+
},
105+
"whitelistDevices": {
106+
"anyOf": [
107+
{
108+
"items": {
109+
"type": "string"
110+
},
111+
"type": "array"
112+
},
113+
{
114+
"type": "string"
115+
}
116+
],
117+
"description": "ONLY scrobble from any cast device that START WITH these values, case-insensitive\n\nIf whitelist is present then blacklist is ignored",
118+
"examples": [
119+
[
120+
"home-mini",
121+
"family-tv"
122+
]
123+
],
124+
"title": "whitelistDevices"
125+
}
126+
},
127+
"title": "ChromecastData",
128+
"type": "object"
129+
},
130+
"ChromecastSourceAIOConfig": {
131+
"properties": {
132+
"clients": {
133+
"description": "Restrict scrobbling tracks played from this source to Clients with names from this list. If list is empty is not present Source scrobbles to all configured Clients.",
134+
"examples": [
135+
[
136+
"MyMalojaConfigName",
137+
"MyLastFMConfigName"
138+
]
139+
],
140+
"items": {
141+
"type": "string"
142+
},
143+
"title": "clients",
144+
"type": "array"
145+
},
146+
"data": {
147+
"$ref": "#/definitions/ChromecastData",
148+
"title": "data"
149+
},
150+
"enable": {
151+
"default": true,
152+
"description": "Should MS use this client/source? Defaults to true",
153+
"examples": [
154+
true
155+
],
156+
"title": "enable",
157+
"type": "boolean"
158+
},
159+
"name": {
160+
"description": "Unique identifier for this source.",
161+
"title": "name",
162+
"type": "string"
163+
},
164+
"options": {
165+
"$ref": "#/definitions/CommonSourceOptions",
166+
"title": "options"
167+
},
168+
"type": {
169+
"enum": [
170+
"chromecast"
171+
],
172+
"title": "type",
173+
"type": "string"
174+
}
175+
},
176+
"required": [
177+
"data",
178+
"type"
179+
],
180+
"title": "ChromecastSourceAIOConfig",
181+
"type": "object"
182+
},
4183
"CommonSourceOptions": {
5184
"properties": {
6185
"logFilterFailure": {
@@ -1461,6 +1640,9 @@
14611640
},
14621641
{
14631642
"$ref": "#/definitions/WebScrobblerSourceAIOConfig"
1643+
},
1644+
{
1645+
"$ref": "#/definitions/ChromecastSourceAIOConfig"
14641646
}
14651647
],
14661648
"title": "SourceAIOConfig"

0 commit comments

Comments
 (0)