metadata-filter icon indicating copy to clipboard operation
metadata-filter copied to clipboard

Artist-specific suffixes

Open djmattyg007 opened this issue 4 years ago • 6 comments

As part of my rabbit hole dive I came across a couple of artists for whom basically all song titles have an artist-specific suffix.

  • Basically all songs by Glee Cast are suffixed with (Glee Cast Version) or - Glee Cast Version

  • It appears all songs by Kelsea Ballerini have titles suffixed with - ballerini album version

Is it appropriate to add artist-specific filters for track titles like this?

djmattyg007 avatar Jan 01 '21 06:01 djmattyg007

And on the subject of multiple types of suffixes, apparently some Glee songs have titles like so:

Smooth Criminal (Glee Cast Version) (feat. 2CELLOS)

djmattyg007 avatar Jan 01 '21 06:01 djmattyg007

Filters (and filter functions) don't know about artists in the context of now playing song. Obviously, you can write a function which uses a hardcoded list of artists, but I don't think it's a good solution.

For now, the only solution is to use custom filter functions in client code. For example, in Web Scrobbler we use a filter function to filter YouTube titles conditionally (yes, this filter function is not a pure function).

Another possible way is to pass this context to the filter, so filter functions would know about additional information they could use to filter a field value. This way also requires building the context object to pass it to the filter.

alexesprit avatar Jan 01 '21 07:01 alexesprit

I believe everything that is suffixed by "Version" label should be removed, right?

alexesprit avatar Jan 01 '21 07:01 alexesprit

Filters (and filter functions) don't know about artists in the context of now playing song. Obviously, you can write a function which uses a hardcoded list of artists, but I don't think it's a good solution.

Sorry, I didn't explain what I was meaning well enough. I definitely don't think it's a good idea to require supplemental metadata (ie. the artist name) to process track titles. What I'm wondering is whether you'd accept a filter to (for example) remove the specific suffix (Glee Cast Version), which will only ever be relevant for a single artist.

And if so, how do you want to categorise these kinds of filters?

I believe everything that is suffixed by "Version" label should be removed, right?

I don't think so. This is what I get with a quick test on the master branch:

[djmattyg007@djmattyg-arch2019 metadata-filter]$ npx ts-node
> const MetadataFilter = require("./src")
undefined
> MetadataFilter.removeVersion("Test Song Name (Glee Cast Version)")
'Test Song Name (Glee Cast Version)'

djmattyg007 avatar Jan 01 '21 10:01 djmattyg007

Aha, I got it.

I think it's fine to add such filters.

And if so, how do you want to categorise these kinds of filters?

I see two different options.

  1. If it's related to Spotify only, it can be added as a separate filter function with own filter rules.
  2. The removeVersion function can be extended to process generic "Version" suffixes, like the fixTrackSuffix function does. The Spotify filter does not include this function, but we can include it.

I don't think so. This is what I get with a quick test on the master branch:

Sorry, I confused it with the fixTrackSuffix which is more generic; removeVersion removes only hardcoded suffixes.

alexesprit avatar Jan 01 '21 10:01 alexesprit

I don't think it would be a good idea to implement a generic "strip Version suffixes" rule, as this would also impact song titles like The Sound of Silence - Acoustic Version, where you probably would want the suffix to be kept.

I guess I'll start by adding these artist-specific filters to the removeVersion ruleset and see how we go from there.

djmattyg007 avatar Jan 03 '21 00:01 djmattyg007