Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Artist-specific suffixes #106

Open
djmattyg007 opened this issue Jan 1, 2021 · 6 comments
Open

Artist-specific suffixes #106

djmattyg007 opened this issue Jan 1, 2021 · 6 comments

Comments

@djmattyg007
Copy link
Contributor

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
Copy link
Contributor Author

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

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

@alexesprit
Copy link
Member

alexesprit commented Jan 1, 2021

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
Copy link
Member

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

@djmattyg007
Copy link
Contributor Author

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)'

@alexesprit
Copy link
Member

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.

@djmattyg007
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants