Skip to content

Commit

Permalink
Add an artist filter for Rekt Network (web-scrobbler#4274)
Browse files Browse the repository at this point in the history
- Extract original artist if it is Mixtape
  • Loading branch information
Mehavoid authored Nov 8, 2023
1 parent abe6671 commit 7fc1b2b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/connectors/rekt.network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,14 @@ Connector.playerSelector = 'body';
Connector.artistTrackSelector = '#nowplaying';

Connector.playButtonSelector = '#playerPlay';

const filter = MetadataFilter.createFilter({
artist: onlyArtist,
});

Connector.applyFilter(filter);

function onlyArtist(artist: string) {
const chunks = artist.split('\n');
return chunks[chunks.length - 1];
}

0 comments on commit 7fc1b2b

Please sign in to comment.