diff --git a/config/config.json.example b/config/config.json.example index c141f26e..bc12c14d 100644 --- a/config/config.json.example +++ b/config/config.json.example @@ -21,6 +21,7 @@ "sources": [ { "type": "spotify", + "enable": true, "clients": ["myConfig"], "name": "mySpotifySource", "data": { @@ -33,6 +34,7 @@ "clients": [ { "type": "maloja", + "enable": true, "name": "myConfig", "data": { "url": "http://localhost:42010", diff --git a/config/deezer.json.example b/config/deezer.json.example index 2a8ec885..6d2664a8 100644 --- a/config/deezer.json.example +++ b/config/deezer.json.example @@ -1,6 +1,7 @@ [ { "name": "FoxxMDeezer", + "enable": true, "clients": [], "data": { "clientId": "a89cba1569901a0671d5a9875fed4be1", diff --git a/config/jellyfin.json.example b/config/jellyfin.json.example index 16eeb487..a9fe8b64 100644 --- a/config/jellyfin.json.example +++ b/config/jellyfin.json.example @@ -1,6 +1,7 @@ [ { "name": "MyJellyfin", + "enable": true, "clients": [], "data": { "users": ["FoxxMD"], diff --git a/config/jriver.json.example b/config/jriver.json.example index 6f6ab3f3..891f2496 100644 --- a/config/jriver.json.example +++ b/config/jriver.json.example @@ -1,6 +1,7 @@ [ { "name": "MyJriver", + "enable": true, "data": { "url": "0.0.0.0", "username": "auser", diff --git a/config/kodi.json.example b/config/kodi.json.example index 3167eef6..5b7ebf34 100644 --- a/config/kodi.json.example +++ b/config/kodi.json.example @@ -1,6 +1,7 @@ [ { "name": "MyKodi", + "enable": true, "data": { "url": "http://localhost:8080/jsonrpc", "username": "myUser", diff --git a/config/lastfm.json.example b/config/lastfm.json.example index a63fa977..7bfdcf57 100644 --- a/config/lastfm.json.example +++ b/config/lastfm.json.example @@ -1,6 +1,7 @@ [ { "name": "myLastFm", + "enable": true, "configureAs": "client", "data": { "apiKey": "a89cba1569901a0671d5a9875fed4be1", diff --git a/config/listenbrainz.json.example b/config/listenbrainz.json.example index 9e0e6781..5bdf8dda 100644 --- a/config/listenbrainz.json.example +++ b/config/listenbrainz.json.example @@ -1,6 +1,7 @@ [ { "name": "brainz", + "enable": true, "configureAs": "client", "data": { "token": "029b081ba-9156-4pe7-88e5-3be671f5ea2b", diff --git a/config/maloja.json.example b/config/maloja.json.example index 7c7e2a73..62f64295 100644 --- a/config/maloja.json.example +++ b/config/maloja.json.example @@ -1,6 +1,7 @@ [ { "name": "myMaloja", + "enable": true, "data": { "url": "http://localhost:42010", "apiKey": "myMalojaKey" diff --git a/config/mopidy.json.example b/config/mopidy.json.example index 58c6ff03..b4f9286e 100644 --- a/config/mopidy.json.example +++ b/config/mopidy.json.example @@ -1,6 +1,7 @@ [ { "name": "MyMopidy", + "enable": true, "data": { "url": "localhost", "uriBlacklist": [], diff --git a/config/mpris.json.example b/config/mpris.json.example index 3026f10c..32d589ff 100644 --- a/config/mpris.json.example +++ b/config/mpris.json.example @@ -1,6 +1,7 @@ [ { "name": "ubuntu", + "enable": true, "data": { "whitelist": ["vlc", "mpd"], "blacklist": ["spotify"] diff --git a/config/plex.json.example b/config/plex.json.example index 0410a3d1..c8350cc0 100644 --- a/config/plex.json.example +++ b/config/plex.json.example @@ -1,6 +1,7 @@ [ { "name": "MyPlex", + "enable": true, "clients": [], "data": { "user": ["username@gmail.com","anotherUser@gmail.com"], diff --git a/config/spotify.json.example b/config/spotify.json.example index 4a2594fe..19dea779 100644 --- a/config/spotify.json.example +++ b/config/spotify.json.example @@ -1,6 +1,7 @@ [ { "name": "MySpotify", + "enable": true, "clients": [], "data": { "clientId": "a89cba1569901a0671d5a9875fed4be1", diff --git a/config/subsonic.json.example b/config/subsonic.json.example index e306478f..4a01fe1d 100644 --- a/config/subsonic.json.example +++ b/config/subsonic.json.example @@ -1,6 +1,7 @@ [ { "name": "MySubsonic", + "enable": true, "data": { "url": "http://localhost:4040/airsonic", "user": "yourUser", diff --git a/config/tautulli.json.example b/config/tautulli.json.example index eaa6c822..ebb8b233 100644 --- a/config/tautulli.json.example +++ b/config/tautulli.json.example @@ -1,6 +1,7 @@ [ { "name": "MyTautuilli", + "enable": true, "clients": [], "data": { "user": ["username@gmail.com","anotherUser@gmail.com"], diff --git a/config/ytmusic.json.example b/config/ytmusic.json.example index 4cd545ab..f052449a 100644 --- a/config/ytmusic.json.example +++ b/config/ytmusic.json.example @@ -1,6 +1,7 @@ [ { "name": "MyYTMusic", + "enable": true, "clients": [], "data": { "cookie": "VISITOR_INFO1_LIVE=jMDXz2_L8rY; __Secure-3PAPISID=3AxsXpSXGqOInSDn1jEKn; DEVICE_INFO=ChxOekU0TmTBpjek5EWZ0G; YSC=7gZdl3Zdl3; SID=TwhNsaZRXYTAtXxzGyu6rZdpg2HvGROeW8J4Ym_FhkhoZMUYEQ.; __Secure-1PSID=TwhNOsaZRXYTyRBe4rxAtXRIKsIEtk_Qot2VLBNfHQrQ.; __Secure-3PSID=ZRXYTAtXRIKsIEtk_Qot2yRBerZdpg2HvvZRXYTAtXRIKsIEtk_Qot2yRBerkuZICFQ.; HSID=A1UMmELW79; SSID=AKhomOs; APISID=IlHHmuzkPdQzZZDhHn3; SAPISID=3AxsXpy0u75Qb/n1jEKn; __Secure-1PAPISID=3AxsXpQb/AkSDn1jEKn; LOGIN_INFO=AFmP6vFpyVCZZAIgDwbkhWMBBhluaIWAPP:QUQ314UW5NWMjNmd2ZUJnYnJsakdIMjZoaE5zVVMjNmd2ZZUiHRlb3ZlV3ZIcUVyRVIMjNmdjNmd2ZZUivYlNqX2ZNZUiHdUNFNFdaYmJIW1NkJRX3hqdlU2YnFESkFuSS1uTldnZVRmLXNjWFc5OUJuR3dTd3JsZGZYa2EtZFQ2a0k2Ry1KQQ==; PREF=volume=26; SIDCC=AFvI_94PxXwls-ndqpGfPgFX3FWj80y_94PxXwls-ndqfSh15sP; __Secure-1PSIDCC=AFvIBnUbRr96I96UCIp2U4T8HRVk2B0HfKzhzxwsiP; __Secure-3PSIDCC=AFvIB3bINuUN0ETDR9gO91wpwWIVmpGki3BxT3bINuUN0ETDR9gO91wCH", diff --git a/src/backend/common/infrastructure/config/common.ts b/src/backend/common/infrastructure/config/common.ts index 5ba98ca7..fe4de683 100644 --- a/src/backend/common/infrastructure/config/common.ts +++ b/src/backend/common/infrastructure/config/common.ts @@ -1,6 +1,13 @@ export interface CommonConfig { name?: string data?: CommonData + /** + * Should MS use this client/source? Defaults to true + * + * @default true + * @examples [true] + * */ + enable?: boolean } export interface CommonData { diff --git a/src/backend/common/schema/aio-client.json b/src/backend/common/schema/aio-client.json index 0cabfea1..c33f967e 100644 --- a/src/backend/common/schema/aio-client.json +++ b/src/backend/common/schema/aio-client.json @@ -101,6 +101,15 @@ "description": "Specific data required to configure this client", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this client. Used with sources to restrict where scrobbles are sent.", "examples": [ @@ -203,6 +212,15 @@ "description": "Specific data required to configure this client", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this client. Used with sources to restrict where scrobbles are sent.", "examples": [ @@ -319,6 +337,15 @@ "description": "Specific data required to configure this client", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this client. Used with sources to restrict where scrobbles are sent.", "examples": [ diff --git a/src/backend/common/schema/aio-source.json b/src/backend/common/schema/aio-source.json index 42163f25..a86c8818 100644 --- a/src/backend/common/schema/aio-source.json +++ b/src/backend/common/schema/aio-source.json @@ -139,6 +139,15 @@ "$ref": "#/definitions/DeezerData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -265,6 +274,15 @@ "$ref": "#/definitions/JRiverData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -417,6 +435,15 @@ "$ref": "#/definitions/JellyData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -545,6 +572,15 @@ "$ref": "#/definitions/KodiData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -601,6 +637,15 @@ "$ref": "#/definitions/LastFmSourceData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -751,6 +796,15 @@ "$ref": "#/definitions/ListenBrainzSourceData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -965,6 +1019,15 @@ "$ref": "#/definitions/MPRISData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -1111,6 +1174,15 @@ "$ref": "#/definitions/MopidyData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -1155,6 +1227,15 @@ "$ref": "#/definitions/PlexSourceData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -1424,6 +1505,15 @@ "$ref": "#/definitions/SpotifySourceData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -1644,6 +1734,15 @@ "$ref": "#/definitions/SubsonicData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -1688,6 +1787,15 @@ "$ref": "#/definitions/PlexSourceData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -1808,6 +1916,15 @@ "$ref": "#/definitions/YTMusicData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", diff --git a/src/backend/common/schema/aio.json b/src/backend/common/schema/aio.json index 6570e563..c70cf9ec 100644 --- a/src/backend/common/schema/aio.json +++ b/src/backend/common/schema/aio.json @@ -212,6 +212,15 @@ "$ref": "#/definitions/DeezerData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -387,6 +396,15 @@ "$ref": "#/definitions/JRiverData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -539,6 +557,15 @@ "$ref": "#/definitions/JellyData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -667,6 +694,15 @@ "$ref": "#/definitions/KodiData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -723,6 +759,15 @@ "$ref": "#/definitions/LastFmSourceData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -868,6 +913,15 @@ "description": "Specific data required to configure this client", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this client. Used with sources to restrict where scrobbles are sent.", "examples": [ @@ -970,6 +1024,15 @@ "description": "Specific data required to configure this client", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this client. Used with sources to restrict where scrobbles are sent.", "examples": [ @@ -1111,6 +1174,15 @@ "$ref": "#/definitions/ListenBrainzSourceData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -1370,6 +1442,15 @@ "$ref": "#/definitions/MPRISData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -1401,6 +1482,15 @@ "description": "Specific data required to configure this client", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this client. Used with sources to restrict where scrobbles are sent.", "examples": [ @@ -1660,6 +1750,15 @@ "$ref": "#/definitions/MopidyData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -1760,6 +1859,15 @@ "$ref": "#/definitions/PlexSourceData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -2094,6 +2202,15 @@ "$ref": "#/definitions/SpotifySourceData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -2314,6 +2431,15 @@ "$ref": "#/definitions/SubsonicData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -2358,6 +2484,15 @@ "$ref": "#/definitions/PlexSourceData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -2489,6 +2624,15 @@ "$ref": "#/definitions/YTMusicData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", diff --git a/src/backend/common/schema/client.json b/src/backend/common/schema/client.json index 53e3f097..29127046 100644 --- a/src/backend/common/schema/client.json +++ b/src/backend/common/schema/client.json @@ -98,6 +98,15 @@ "description": "Specific data required to configure this client", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this client. Used with sources to restrict where scrobbles are sent.", "examples": [ @@ -192,6 +201,15 @@ "description": "Specific data required to configure this client", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this client. Used with sources to restrict where scrobbles are sent.", "examples": [ @@ -300,6 +318,15 @@ "description": "Specific data required to configure this client", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this client. Used with sources to restrict where scrobbles are sent.", "examples": [ diff --git a/src/backend/common/schema/source.json b/src/backend/common/schema/source.json index 0f8d9647..9bd8b494 100644 --- a/src/backend/common/schema/source.json +++ b/src/backend/common/schema/source.json @@ -180,6 +180,15 @@ "$ref": "#/definitions/DeezerData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -298,6 +307,15 @@ "$ref": "#/definitions/JRiverData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -442,6 +460,15 @@ "$ref": "#/definitions/JellyData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -562,6 +589,15 @@ "$ref": "#/definitions/KodiData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -704,6 +740,15 @@ "$ref": "#/definitions/LastFmSourceData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -752,6 +797,15 @@ "$ref": "#/definitions/ListenBrainzSourceData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -958,6 +1012,15 @@ "$ref": "#/definitions/MPRISData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -1096,6 +1159,15 @@ "$ref": "#/definitions/MopidyData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -1132,6 +1204,15 @@ "$ref": "#/definitions/PlexSourceData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -1316,6 +1397,15 @@ "$ref": "#/definitions/SpotifySourceData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -1442,6 +1532,15 @@ "$ref": "#/definitions/SubsonicData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -1564,6 +1663,15 @@ "$ref": "#/definitions/PlexSourceData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", @@ -1676,6 +1784,15 @@ "$ref": "#/definitions/YTMusicData", "title": "data" }, + "enable": { + "default": true, + "description": "Should MS use this client/source? Defaults to true", + "examples": [ + true + ], + "title": "enable", + "type": "boolean" + }, "name": { "description": "Unique identifier for this source.", "title": "name", diff --git a/src/backend/scrobblers/ScrobbleClients.ts b/src/backend/scrobblers/ScrobbleClients.ts index cf23a71c..274fa80c 100644 --- a/src/backend/scrobblers/ScrobbleClients.ts +++ b/src/backend/scrobblers/ScrobbleClients.ts @@ -296,7 +296,13 @@ ${sources.join('\n')}`); if (isValidConfig !== true) { throw new Error(`Config object from ${clientConfig.source || 'unknown'} with name [${clientConfig.name || 'unnamed'}] of type [${clientConfig.type || 'unknown'}] has errors: ${isValidConfig.join(' | ')}`) }*/ - const {type, name, data: d = {}} = clientConfig; + const {type, name, enable = true, data: d = {}} = clientConfig; + + if(enable === false) { + this.logger.warn(`${type} (${name}) client was disabled by config`); + return; + } + // add defaults const data = {...defaults, ...d}; let newClient; diff --git a/src/backend/sources/ScrobbleSources.ts b/src/backend/sources/ScrobbleSources.ts index 2fca2a25..25d2fd5a 100644 --- a/src/backend/sources/ScrobbleSources.ts +++ b/src/backend/sources/ScrobbleSources.ts @@ -410,7 +410,7 @@ export default class ScrobbleSources { } } - addSource = async (clientConfig: any, defaults: SourceDefaults = {}) => { + addSource = async (clientConfig: ParsedConfig, defaults: SourceDefaults = {}) => { // const isValidConfig = isValidConfigStructure(clientConfig, {name: true, data: true, type: true}); // if (isValidConfig !== true) { // throw new Error(`Config object from ${clientConfig.source || 'unknown'} with name [${clientConfig.name || 'unnamed'}] of type [${clientConfig.type || 'unknown'}] has errors: ${isValidConfig.join(' | ')}`) @@ -422,7 +422,12 @@ export default class ScrobbleSources { logger: this.logger }; - const {type, name, data: d = {}, options: clientOptions = {}} = clientConfig; + const {type, name, data: d = {}, enable = true, options: clientOptions = {}} = clientConfig; + + if(enable === false) { + this.logger.warn(`${type} (${name}) source was disabled by config`); + return; + } // add defaults const {options: defaultOptions = {}, ...restDefaults} = defaults;