Skip to content

Commit

Permalink
Add AzuraCast connector (web-scrobbler#4567)
Browse files Browse the repository at this point in the history
* Adding AzuraCast connector to connectors.ts

* Created azuracast.ts

* First attempt at azuracast.ts

* missed an end '

* fixed lint errors

* ran prettierfix

* adding wildcard in connectors.ts to pass test

* had logic for playing check backwards

* adjusting button detection

* Update src/core/connectors.ts

removing unnecessary url match

Co-authored-by: yayuyokitano <[email protected]>

---------

Co-authored-by: yayuyokitano <[email protected]>
  • Loading branch information
ofsaleem and yayuyokitano authored Mar 16, 2024
1 parent 8478e0e commit 926339e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/connectors/azuracast.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Connector.useMediaSessionApi();

Connector.playerSelector = '.radio-player-widget';

Connector.artistSelector =
'.now-playing-details .now-playing-main div.now-playing-artist';

Connector.trackSelector = '.now-playing-title';

Connector.trackArtSelector = '.now-playing-art .album-art .album-art';

Connector.isPlaying = () =>
Util.getAttrFromSelectors(
'.radio-controls .radio-control-play-button',
'title',
) === 'Stop';
5 changes: 5 additions & 0 deletions src/core/connectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2397,4 +2397,9 @@ export default <ConnectorMeta[]>[
js: 'earth.fm.js',
id: 'earthfm',
},
{
label: 'AzuraCast',
js: 'azuracast.js',
id: 'azuracast',
},
];

0 comments on commit 926339e

Please sign in to comment.