[GH-ISSUE #23] Filter album types #21

Closed
opened 2026-02-27 04:57:08 +03:00 by kerem · 10 comments
Owner

Originally created by @U2EZNeko on GitHub (Jun 13, 2025).
Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/23

Originally assigned to: @Googolplexed0 on GitHub.

When i grab a whole discography, especially of older artists, I end up with like 30 Live albums or compilations.

Is it possible to filter out specific album types?

Originally created by @U2EZNeko on GitHub (Jun 13, 2025). Original GitHub issue: https://github.com/Googolplexed0/zotify/issues/23 Originally assigned to: @Googolplexed0 on GitHub. When i grab a whole discography, especially of older artists, I end up with like 30 Live albums or compilations. Is it possible to filter out specific album types?
kerem 2026-02-27 04:57:08 +03:00
Author
Owner

@Googolplexed0 commented on GitHub (Jun 15, 2025):

I will look into this, could be a nice config flag. It will mostly depend on if the API stores some kind of LIVE album flag like they do for COMPILATION albums. Not really comfortable skipping albums using a song title regex due to very easy false positives no matter what/how a specific filter is implemented.

<!-- gh-comment-id:2973397960 --> @Googolplexed0 commented on GitHub (Jun 15, 2025): I will look into this, could be a nice config flag. It will mostly depend on if the API stores some kind of LIVE album flag like they do for COMPILATION albums. Not really comfortable skipping albums using a song title regex due to _very_ easy false positives no matter what/how a specific filter is implemented.
Author
Owner

@U2EZNeko commented on GitHub (Jun 15, 2025):

Very much appreciated. Even skipping compilations would avoid so many duplicate tracks.

Maybe a config option for user-filters?
I wouldn't mind the occasional missing album if I can set Live at*, Live from* or something similar would be neat.

<!-- gh-comment-id:2973793745 --> @U2EZNeko commented on GitHub (Jun 15, 2025): Very much appreciated. Even skipping compilations would avoid so many duplicate tracks. Maybe a config option for user-filters? I wouldn't mind the occasional missing album if I can set Live at*, Live from* or something similar would be neat.
Author
Owner

@Googolplexed0 commented on GitHub (Jun 16, 2025):

NO_COMPILATION_ALBUMS config option added with 0afa82785f, not sure how frequently the API actually uses the "album_type" = "compilation" flag though.

User regex filters is something that I actually think would be a really good idea, though it would be very powerful. I'll experiment with that now.

<!-- gh-comment-id:2975017983 --> @Googolplexed0 commented on GitHub (Jun 16, 2025): NO_COMPILATION_ALBUMS config option added with 0afa82785fbb6de9210a190b5d26e55c1b7fc6d4, not sure how frequently the API actually uses the `"album_type" = "compilation"` flag though. User regex filters is something that I actually think would be a really good idea, though it would be very powerful. I'll experiment with that now.
Author
Owner

@Googolplexed0 commented on GitHub (Jun 16, 2025):

@U2EZNeko, please check out the new branch user-regex-filters (via 3878a4e). User Regex filters are only implemented for albums right now, but it should be very easy to expand to all other items. I also included a simple example Regex for filtering out live performances in the README in the Example Regex Values section.

EDIT: Expanded functionality to tracks and podcast episodes, don't see much value in adding it for playlists or artists.

Give the branch a beta test and let me know if you find any issues.

<!-- gh-comment-id:2975159091 --> @Googolplexed0 commented on GitHub (Jun 16, 2025): @U2EZNeko, please check out the new branch [user-regex-filters](https://github.com/Googolplexed0/zotify/tree/user-regex-filters) (via 3878a4e). User Regex filters are only implemented for albums right now, but it should be very easy to expand to all other items. I also included a simple example Regex for filtering out live performances in the `README` in the `Example Regex Values` section. EDIT: Expanded functionality to tracks and podcast episodes, don't see much value in adding it for playlists or artists. Give the branch a beta test and let me know if you find any issues.
Author
Owner

@U2EZNeko commented on GitHub (Jun 16, 2025):

I'd love to but im running into some rather noob-ish issues.

pipx install git+https://github.com/Googolplexed0/zotify.git@user-regex-filters

doesnt seem to work, how exactly do I install the specific branch with pipx if I may ask?

<!-- gh-comment-id:2977197154 --> @U2EZNeko commented on GitHub (Jun 16, 2025): I'd love to but im running into some rather noob-ish issues. pipx install git+https://github.com/Googolplexed0/zotify.git@user-regex-filters doesnt seem to work, how exactly do I install the specific branch with pipx if I may ask?
Author
Owner

@Googolplexed0 commented on GitHub (Jun 16, 2025):

Not your fault, I used an invalid version number (it had letters). Fixed with ea3f62adc795aa269094fa121a64de4215715cf6, the pipx install should work now.

<!-- gh-comment-id:2977412459 --> @Googolplexed0 commented on GitHub (Jun 16, 2025): Not your fault, I used an invalid version number (it had letters). Fixed with ea3f62adc795aa269094fa121a64de4215715cf6, the pipx install should work now.
Author
Owner

@U2EZNeko commented on GitHub (Jun 17, 2025):

Pull worked this time.
Using your regex example for now.

I've got my script running, we'll see if it worked tomorrow when the downloads are finished.

On a side note because i couldn't find it in the readme.
Can I set multiple patterns? Whats the delimiter for the config file?

<!-- gh-comment-id:2980594039 --> @U2EZNeko commented on GitHub (Jun 17, 2025): Pull worked this time. Using your regex example for now. I've got my script running, we'll see if it worked tomorrow when the downloads are finished. On a side note because i couldn't find it in the readme. Can I set multiple patterns? Whats the delimiter for the config file?
Author
Owner

@Googolplexed0 commented on GitHub (Jun 17, 2025):

There is no explicit delimiter for multiple regexes, however, you can add multiple patterns into a single regex by chaining the "or" construction (|) : (:?<first pattern here>)|(:?<second pattern here>)|(:?<third pattern here>). It can also be recursively stacked, as seen in the Live Performances example.

<!-- gh-comment-id:2980922093 --> @Googolplexed0 commented on GitHub (Jun 17, 2025): There is no explicit delimiter for multiple regexes, however, you can add multiple patterns into a single regex by chaining the "or" construction (`|`) : `(:?<first pattern here>)|(:?<second pattern here>)|(:?<third pattern here>)`. It can also be recursively stacked, as seen in the Live Performances example.
Author
Owner

@U2EZNeko commented on GitHub (Jun 17, 2025):

I ended up using this:
(?:(|[|{)[Ll]ive.?(?:)|]|})|[Cc]ommentary|[Rr]e-?master|(?:[Ss]potify|[Rr]adio|[Pp]aramour)\s[Ss]ession|(?:[Ll]ive\s(?:[Ff]rom|[Aa]t|[Ii]n))\s\S

Working fine so far.

EDIT: Pasted old regex

<!-- gh-comment-id:2981276186 --> @U2EZNeko commented on GitHub (Jun 17, 2025): I ended up using this: (?:\(|\[|\{)[Ll]ive.*?(?:\)|\]|\})|[Cc]ommentary|[Rr]e-?master|(?:[Ss]potify|[Rr]adio|[Pp]aramour)\s[Ss]ession|(?:[Ll]ive\s(?:[Ff]rom|[Aa]t|[Ii]n))\s\S* Working fine so far. EDIT: Pasted old regex
Author
Owner

@Googolplexed0 commented on GitHub (Jun 17, 2025):

If all seems well, then I'll close the issue and start merging the branch into main (just FYI, the regex matches are case-insensitive, so you don't need to account for that if you want to make your pattern more readable).

<!-- gh-comment-id:2981655247 --> @Googolplexed0 commented on GitHub (Jun 17, 2025): If all seems well, then I'll close the issue and start merging the branch into main (just FYI, the regex matches are case-insensitive, so you don't need to account for that if you want to make your pattern more readable).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/zotify#21
No description provided.