Skip to content
This repository has been archived by the owner on May 3, 2019. It is now read-only.

Commit

Permalink
Add support for un-favoriting to soundcloud plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Rasmus Thomsen authored and Rasmus Thomsen committed Oct 20, 2017
1 parent c29d607 commit 3addf18
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions plugins/soundcloud/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function update() {
"artistName": '',
"albumTitle": '',
"artUrl": artUrl,
"isFavorite": false
"isFavorite": isFavorite()
}
}

Expand All @@ -78,6 +78,13 @@ function readTime(elementClassName) {
return hours * 3600 + minutes * 60 + seconds;
}

function isFavorite() {
if (document.getElementsByClassName('playbackSoundBadge__like')[0].title === "Unlike")
return true;
else
return false;
}

function clickButton(buttonName) {
document.getElementsByClassName(buttonName)[0].click()
}
Expand All @@ -102,11 +109,11 @@ function addToFavorites() {
clickButton('playbackSoundBadge__like');
}

function setVolume(volume) {
// not supported
function removeFromFavorites() {
addToFavorites();
}

function removeFromFavorites() {
function setVolume(volume) {
// not supported
}

Expand Down

0 comments on commit 3addf18

Please sign in to comment.