-
-
Notifications
You must be signed in to change notification settings - Fork 539
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Working connector * Changing to track the button on the player to allow for scrobbling all over the site, extending list of URLs * Splitting into separate `getTrack` and `getArtist` functions * Changing to nullish coalescing to avoid unnecessary checks * fix title const from let * Rename NTS to NTS Live for better disambiguation * Remove trailing slashes from URLs to allow for search results etc. * Increase spacing around info box
- Loading branch information
1 parent
591734d
commit 3992764
Showing
3 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
File renamed without changes.
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,28 @@ | ||
export {}; | ||
|
||
Connector.playerSelector = '.episode-player-wrapper'; | ||
|
||
Connector.isPlaying = () => { | ||
const title = document.querySelector('.soundcloud-player__play-icon title'); | ||
if (title && title.textContent === 'Play') { | ||
return false; | ||
} | ||
return true; | ||
}; | ||
|
||
Connector.getTrack = () => | ||
document.querySelector( | ||
'.episode-player-tracklist__track--is-playing .episode-player-tracklist__title', | ||
)?.textContent; | ||
|
||
Connector.getArtist = () => | ||
document.querySelector( | ||
'.episode-player-tracklist__track--is-playing .episode-player-tracklist__artist', | ||
)?.textContent; | ||
|
||
Connector.scrobbleInfoLocationSelector = '.soundcloud-player__content'; | ||
Connector.scrobbleInfoStyle = { | ||
...Connector.scrobbleInfoStyle, | ||
fontSize: '0.5em', | ||
marginLeft: '2em', | ||
}; |
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