Shpigford / plylst

Smart playlists for Spotify! Stop relying on fancy pants algorithms to organize your library and instead build playlists the way you want.
https://plylst.app
MIT License
331 stars 52 forks source link

Add "Not in Library" filter #61

Closed maxnowack closed 4 years ago

maxnowack commented 4 years ago

Hey, thanks a lot for your great work on this project! 🙂 I'm trying to create a playlist with all the songs I have listened to at least 3 times, but they are not in my library. I haven't found a filter for "in library". Am I missing something or is it not implemented yet?

Shpigford commented 4 years ago

@maxnowack When you say "In Library" what do you mean? The basis for the songs we pull in are from songs you've "Liked".

Then, you'd just select "Only my library" as the source.

CleanShot 2020-02-18 at 09 35 16@2x
maxnowack commented 4 years ago

@Shpigford yes, but I want to select all the songs I've listened at least three times, but only the songs, which are not in my library. I think that's currently not possible, because I need "All songs" as the source, but want to exclude the songs in my library.

Shpigford commented 4 years ago

@maxnowack Ah! Gotcha. You want a "Not in Library" filter. Will add that to the list. Have also updated the ticket title.

maxnowack commented 4 years ago

@Shpigford can you give me a hint how this feature could theoretically be implemented? I want to try it by myself 🙂

Shpigford commented 4 years ago

@maxnowack Sure! Check the filtered_tracks method.

Those first few lines ultimately pick where songs come from.

What you're wanting to start with is basically selecting all tracks where follows.active is NOT true (as well as where there's no follows.active present).

Then you can edit the form dropdown in the _form.html.erb file.