forked from web-scrobbler/web-scrobbler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix connector for BrainFM (web-scrobbler#4272)
* Fix connector for BrainFM * Apply linter rules
- Loading branch information
Showing
2 changed files
with
13 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
export {}; | ||
|
||
Connector.playerSelector = '[class^="Controls__wrapper___"]'; | ||
Connector.playerSelector = '#root'; | ||
|
||
Connector.trackSelector = `${Connector.playerSelector} [class^="Controls__brainState___"]`; | ||
Connector.pauseButtonSelector = '[data-testid="playPauseButton"] > div > img'; | ||
|
||
Connector.pauseButtonSelector = `${Connector.playerSelector} svg[class^=PlayControl__pause___]`; | ||
Connector.trackArtSelector = | ||
'[data-testid="currentTrackInformationCard"] > img'; | ||
|
||
Connector.getTrack = () => { | ||
const elements = Util.queryElements('[data-testid="currentTrackTitle"]'); | ||
if (!elements) { | ||
return null; | ||
} | ||
return elements[0]?.firstChild?.textContent; | ||
}; | ||
|
||
Connector.getArtist = () => 'Brain.fm'; |
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