Skip to content

Commit

Permalink
Merge pull request #184 from Senpos/fix-pandora-070119
Browse files Browse the repository at this point in the history
Fix pandora.com
  • Loading branch information
senpos authored Jan 7, 2019
2 parents 70c95c4 + 02d2ad0 commit 99d102c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion data/common/options/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}
return (
h('div', { id: 'app' },
h(HeaderComponent, { version: 'v4.7.1', history: this.state.history }),
h(HeaderComponent, { version: 'v4.7.2', history: this.state.history }),
h('div', { id: 'container' },
h('div', { id: 'main-content' },
h(Router, { history: this.state.history },
Expand Down
6 changes: 6 additions & 0 deletions data/common/options/changelog.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"4.7.2": {
"date": "07 January 19",
"fixed": [
"pandora.com"
]
},
"4.7.1": {
"date": "21 April 18",
"other": [
Expand Down
12 changes: 4 additions & 8 deletions data/common/websites-support/websites/pandora.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,25 @@ const PandoraTrackListener = function() {};
PandoraTrackListener.prototype = new window.UNPCommon.WebsiteTrackListener();

PandoraTrackListener.prototype.isPlaying = function() {
return $('button[data-qa=pause_button]').length ? true : false;
return !!$('button[data-qa=pause_button]').length;
};

PandoraTrackListener.prototype.findSelector = function() {
this.selector = $('div.Tuner__ContentWrapper');
};

PandoraTrackListener.prototype.scrapPlayData = function() {
this.artistName = this.selector.find('div.Tuner__Audio__TrackDetail__artist > a[data-qa=mini_track_artist_name]').text();
this.artistName = this.selector.find('.Tuner__Audio__TrackDetail__artist[data-qa=mini_track_artist_name]').text();

// since track name and url are in the same selector, doing all stuff here
this.trackSelector = this.selector.find('.Tuner__Audio__TrackDetail__title > a[data-qa=mini_track_title]');
this.trackSelector = this.selector.find('.Tuner__Audio__TrackDetail__title[data-qa=mini_track_title]');
this.trackName = this.trackSelector.text();
this.url = 'https://pandora.com' + this.trackSelector.attr('href');
return true;
};

PandoraTrackListener.prototype.scrapAlbumName = function() {
return this.selector.find('a[data-qa=playing_album_name]').text();
};

PandoraTrackListener.prototype.scrapAlbumArt = function() {
return this.selector.find('div.Tuner__Audio__TrackDetail__img').find('img').attr('src').replace('90W_90H', '500W_500H');
return this.selector.find('.Tuner__Audio__TrackDetail__img').find('img').attr('src').replace('90W_90H', '500W_500H');
};

PandoraTrackListener.prototype.scrapDuration = function() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"title": "Untamed Now Playing",
"id": "jid1-CCXBUPa5pAmTYw@jetpack",
"name": "unp",
"version": "4.7.1",
"version": "4.7.2",
"description": "Save 'now playing' data from music websites locally in TXT/JSON/XML",
"author": "Wykks",
"engines": {
Expand Down

0 comments on commit 99d102c

Please sign in to comment.