Skip to content

Commit

Permalink
Fix scrobbling due to NRK redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMamen committed Jul 7, 2020
1 parent 3becbef commit 81078b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "__MSG_appName__",
"short_name": "__MSG_appShortName__",
"version": "2.3.0",
"version": "2.4.0",
"manifest_version": 2,
"description": "__MSG_appDescription__",
"icons": {
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/src/content/item-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ItemParser.isEpisodeOrMovie = function () {
};

ItemParser.isReady = function checkPage() {
return document.querySelector("a.tv-series-episode-list-item--active") !== null || document.querySelector("h1.tv-program-header__title") !== null;
return document.querySelector("a.tv-series-episode-list-item--selected") !== null || document.querySelector("h1.tv-program-header__title") !== null;
};

ItemParser.parse = function parse(callback) {
Expand All @@ -26,7 +26,7 @@ ItemParser.parse = function parse(callback) {
} else if (seriesTitleElement) {
type = "show";
mainTitle = seriesTitleElement.textContent;
const uri = document.querySelector("a.tv-series-episode-list-item--active").getAttribute("href");
const uri = document.querySelector("a.tv-series-episode-list-item--selected").getAttribute("href");
if (!uri.split('/')[3] || uri.split('/')[3] !== 'sesong') {
Rollbar.error("Unexpected URL-format", uri);
return;
Expand Down
6 changes: 3 additions & 3 deletions app/scripts/src/content/watch-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ WatchEvents.prototype = {
},

isPlaying: function() {
const playIcon = document.getElementsByClassName("ludo-playicon")[0];
if (playIcon) {
return (/ludo-playicon--pause/.test(playIcon.className));
const playIcons = document.getElementsByClassName("ludo-playicon");
if (playIcons.length) {
return (/ludo-playicon--pause/.test(playIcons[playIcons.length-1].className));
};
return false;
}
Expand Down

0 comments on commit 81078b2

Please sign in to comment.