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

ignore_smart_in applied to all collections regardless of size, prevents deletion #2522

Open
hwwilliams opened this issue Feb 23, 2025 · 4 comments
Assignees
Labels
bug Bug is with Plex Meta Manager status:not-yet-viewed I haven't reviewed the Feature or Bug yet

Comments

@hwwilliams
Copy link

hwwilliams commented Feb 23, 2025

Version Number

2.1.0-build72

What branch are you on?

nightly

Describe the Bug

Looking at the code in the nightly branch points to some possibly weird behavior.

The default value for ignore_empty_smart_collections is True if you don't set it (Config Warning: ignore_empty_smart_collections attribute not found using True as default).

If you have non-empty smart collections that are not configured but are managed and you're using delete_collection operations this seems to cause a bug for me.

The code that checks for deleting collections has a condition that checks that setting and it would seem to resolve as follows.

less_check = not ignore_smart_in if col_in.smart else True
less_check = not True if True else True
less_check = False

which would mean it isn't marked for deletion due to the condition on the final return .

return all((less_check, managed_check, configured_check)) 

This code is only in the nightly branch, not the main branch.

It seems like the ignore_smart_in option is suppose to only apply to a collection if the collection is empty but it's applying to all collections regardless of size.

Relevant Collection/Overlay/Playlist Definition

Logs

https://gist.github.com/hwwilliams/ff372edb92af4ea26d3a0ed6832f75a1

@hwwilliams hwwilliams added bug Bug is with Plex Meta Manager status:not-yet-viewed I haven't reviewed the Feature or Bug yet labels Feb 23, 2025
@antwanchild
Copy link
Contributor

So are you saying it works properly in nightly?

@hwwilliams
Copy link
Author

hwwilliams commented Feb 23, 2025

So are you saying it works properly in nightly?

No it doesn't since there is no condition check for the size of the collection. The bug doesn't exist in the main branch but I'm sure the code was added to nightly to fix something else.

If I add the setting ignore_empty_smart_collections to my config and set it to False instead of defaulting to True then all the expected collections are deleted for me with my current configuration settings, whereas if I did not set it to False I would see collections in the logs that are marked for deletion (managed but not in config) but were not deleted due to this bug.

I attached my log file to the bug, if you search for the Deleting Collections section you can see many collections have all conditions marked as true and should then be deleted but the only one that is deleted is the single collection (AniList Season) that is not a smart collection.

I assume that ignore_empty_smart_collections is suppose to be the same as ignore_smart_in since it is passed as a parameter, maybe that is another mistake and there is meant to be an ignore smart collection option as well as an ignore empty smart collection option, either way the current method in the nightly branch results in a bug because I shouldn't have to disable ignore_empty_smart_collections for it to delete non-empty smart collections.

ignore_smart = self.library.delete_collections["ignore_empty_smart_collections"] if self.library.delete_collections else True

if should_be_deleted(col, labels, configured, managed, less, ignore_smart):

@antwanchild
Copy link
Contributor

antwanchild commented Feb 23, 2025

I thought this was fixed in nightly, by removing the less check https://discord.com/channels/822460010649878528/966824657971974214/1298672118023716864

@hwwilliams
Copy link
Author

hwwilliams commented Feb 23, 2025

I thought this was fixed in nightly, by removing the less check https://discord.com/channels/822460010649878528/966824657971974214/1298672118023716864

If this is linking to the correct fix in nightly then that seems to only fix something for empty smart collections, my collections are not empty but they are also not being deleted when they should be.

I am also not using a less check, so whatever the default value is for the less check is what my config would be using.

My entire config is shown in the logs I attached to this bug if you would like to review it, I do believe this is a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug is with Plex Meta Manager status:not-yet-viewed I haven't reviewed the Feature or Bug yet
Projects
None yet
Development

No branches or pull requests

3 participants