-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
1,722 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"name": "MyWebScrobbler", | ||
"slug": null, | ||
"data": { | ||
"whitelist": [], | ||
"blacklist": [] | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
src/backend/common/infrastructure/config/source/webscrobbler.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { CommonSourceConfig, CommonSourceData } from "./index"; | ||
|
||
export interface WebScrobblerData extends CommonSourceData { | ||
/** | ||
* The URL ending that should be used to identify scrobbles for this source | ||
* | ||
* In WebScrobbler's Webhook you must set an 'API URL'. All MS WebScrobbler sources must start like: | ||
* | ||
* http://localhost:9078/api/webscrobbler | ||
* | ||
* If you are using multiple WebScrobbler sources (scrobbles for many users) you must use a slug to match Sources with each users extension. | ||
* | ||
* Example: | ||
* | ||
* * slug: 'usera' => API URL: http://localhost:9078/api/webscrobbler/usera | ||
* * slug: 'userb' => API URL: http://localhost:9078/api/webscrobbler/userb | ||
* | ||
* If no slug is found from an extension's incoming webhook event the first WebScrobbler source without a slug will be used | ||
* */ | ||
slug?: string | null | ||
|
||
/** | ||
* Block scrobbling from specific WebScrobbler Connectors | ||
* | ||
* @examples [["youtube"]] | ||
* */ | ||
blacklist?: string | string[] | ||
|
||
/** | ||
* Only allow scrobbling from specific WebScrobbler Connectors | ||
* | ||
* @examples [["mixcloud","soundcloud","bandcamp"]] | ||
* */ | ||
whitelist?: string | string[] | ||
|
||
/** | ||
* Additional options for WebScrobbler logging and tuning | ||
* */ | ||
options?: { | ||
/** | ||
* Log raw WebScrobbler webhook payload to debug | ||
* | ||
* @default false | ||
* @examples [false] | ||
* */ | ||
logPayload?: boolean | ||
|
||
/** | ||
* How MS should log when a WebScrobbler event fails a defined filter | ||
* | ||
* * `false` => do not log | ||
* * `debug` => log to DEBUG level | ||
* * `warn` => log to WARN level (default) | ||
* | ||
* @default warn | ||
* @examples ["warn"] | ||
* */ | ||
logFilterFailure?: false | 'debug' | 'warn' | ||
} | ||
} | ||
|
||
export interface WebScrobblerSourceConfig extends CommonSourceConfig { | ||
data?: WebScrobblerData | ||
} | ||
|
||
export interface WebScrobblerSourceAIOConfig extends WebScrobblerSourceConfig { | ||
type: 'webscrobbler' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.