feross / play.cash

🎶 Music lovers, rejoice.

Home Page:https://play.cash

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong song: Skip full albums

feross opened this issue · comments

https://play.cash/Green-Day/21st-Century-Breakdown plays the entire album since the song and the album share the name.

Consider skipping tracks with "Full Album" in the title, e.g. Green Day - "21st Century Breakdown" 2009 [Full Album]

Implemented some nice heuristics for this:

        // Promote "official version" videos (e.g. with "(Official)" in the title)
        if (OFFICIAL_REGEX.test(title)) item.rank += 7

        // Demote "live version" videos (e.g. with "(Live)" in the title)
        if (LIVE_REGEX.test(title)) item.rank -= 7

        // Demote "full album" videos (e.g. with "(Full Album)" in the title)
        if (FULL_ALBUM_REGEX.test(title)) item.rank -= 15

        // Promote videos from channels with the artist's name (e.g. "Michael Jackson" or
        // "MichaelJackson")
        if (channelTitle.includes(artistName)) item.rank += 15
        if (artistName.includes(' ') &&
            channelTitle.includes(artistName.replace(/ /g, ''))) item.rank += 15

        // Promote videos from a VEVO account, since it's likely official
        if (channelTitle.endsWith('vevo')) item.rank += 15

        // Promote videos from channels with "official" in the title
        if (channelTitle.includes('official')) item.rank += 7