-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Exclude movies in collections created in Plex #688
Comments
Hey! Sorry for the late reply. There's an issue with the 'Plex - Present in amount of other collections' rule in release 1.7.0, which is why it doesn't work as expected. It's currently fixed in the develop branch and will be available in the next release. Once the rule is functioning, it should achieve what you desire. |
This bug seems to still be unresolved in 1.7.1. When I run a rule for movies present in 0 other collections, it adds a movie that matches the rest of the rules to my custom collection, but on the next run it removes that movie from the collection, and then it just keeps cycling like that for consecutive runs, adding it and removing it from the collection. It does keep a movie that does not match the rules at all which I added manually to the collection in Plex, if that is helpful. I've had a look at the source code, and it seems to be correct, but it does not seem to work for some reason. Update: |
Can you provide a screenshot of your original (non-working) rule? There might be a logical explanation for the observed behavior. If not, I'll attempt to replicate it for further investigation. |
If you're willing to experiment with a preview build and are comfortable using something like Postman or Insomnia, you might want to explore a feature I've been developing. While the backend code is complete, please be aware that the UI component is not, so for now it's only callable through the API. This feature allows you to test a particular media item with your rule, providing a detailed breakdown of each evaluation along with the compared values. This could be valuable in understanding the actions applied to your failing media items. If you're interested, give it a try and let me know your observations or any feedback you may have. To give it a try, follow these instructions:
|
I've updated the above instructions since there's a basic UI available now. You won't need any external apps anymore. |
Sorry for the delay, but here is what I'm seeing. This is for an item that stays in the collection between runs:
This is for an item that is added or removed from the collection every run while currently in the collection:
This is for an item that is added or removed from the collection every run while not currently in the collection:
This is the logs that produced the previous state:
Running the rules again produces these logs:
Testing the media again after that run shows the opposite, the result is |
Thank you for providing this detailed report! Regarding the item that remains in the collection, could you attempt to manually remove it? Subsequently, remove the exclusion for the item that was created due to this action. It is possible that Maintainerr assumes the record was added manually. If the item no longer appears after these actions, that likely confirms the case. As for the other items, it seems they are consistently shifting between collections. They seem to be added to one collection, then removed from another, and vice versa—all because the condition 'Plex - Present in amount of other collections' no longer aligns. To troubleshoot, consider adding the 'Plex - collections media is present in' rule to your rule set. Just for testing purposes, it will include the collection names in the test output. This may shed light on the shifting behavior of these items. |
Adding that additional rule gives some interesting insight, I think: For the item (
For the shifting item (
For the shifting item (
You would expect that the first and second item would have the same results for that ruleset, because both are currently in the "Leaving soon" collection, but it's the one currently not in the collection that has the same results. This brings me back to my initial idea about the cached metadata might be out of sync, which might cause this function to then return inaccurate data: Now, back to what you first suggested with removing that item ( When it's not in the collection (before rules have run):
Running the rule added it to the collection (as expected), but checking it again looks exactly like before, like the cached metadata was not updated:
Running the rule removes it from the collection (I guess this is what I expected?), and it's back to looking like the other switching item:
Re-running the rule now adds it or removes it (and another of the switching items). Here are the logs, just for good measure:
As a last note, I'm not sure what I did initially to make the first item ( Edit: I would try and help out by trying to write a test to reproduce this if it was a language I was more familiar with, but I haven't worked with JS since jQuery was popular and I've never learned TS, plus I've never used Jest, so I'm afraid I don't really know how helpful I can be. |
Thank you for your input! You may be on to something.. Upon further investigation, it seems that the problem may be associated with the particular stage at which I clear the cache. Currently, I clear the cache at the initiation of the rule execution task. So, if an item is added to a collection by one ruleset, the next ruleset may utilize outdated metadata due to caching by the previous ruleset. So if the first one added it to it's collection, the second one won't see it during that run. Could this potentially explain the observed behavior? Here is the portion of the code where the cache is cleared:
|
@bolmstedt, PR #801 might fix your issue. Once merged, you should be able to try it out with the latest develop/main image. |
Tried the latest develop image, and although it is flushing the cache, sadly the behavior looks just like before when running the rule:
Item
Item
I though that your fix would solve the issue, but I'm not sure why it seems to have no effect. I am now wondering if there is something strange with this Plex collection getter, if it is not filtering the custom collection name properly, because I would assume that a movie in that collection would be counted as being in 0 collection, not 1. |
Just to make sure, I'm beginning to feel a bit confused. Is the 'Leaving Soon' collection in anyway related to this rule? Is it for instance, the custom collection name? And are both shifting items consistently included in the 'Leaving Soon' collection? |
Exactly, "Leaving soon" is the name of the custom collection related to that ruleset. All mentioned shifting items are being added and removed from that collection. I realise now that I've not tried to not have a custom collection yet, if that makes a difference. I'll try that later tonight or tomorrow. |
You don't have to, i've figured it out. Fix in #804 As you suspected, the rule was just wrong in conjunction with a manual collection. the properties Additionally, I addressed another small caching oversight related to 'test media'. Previously, it would utilize the last cached metadata from Plex, which might not be up to date. Now, when testing media, it clears the item's cache first to ensure accuracy. Once merged, you're able to test it out with the develop/main image. |
Yes, I noticed that it started working during the weekend, thank you! I'll stay on develop until there is a new release. |
Closing but if there is still a problem, please re-open. |
Describe the bug
I don't know if this is actually a bug but what I'm trying to accomplish is somewhat the same as the following feature request: #493
I want to create a rule to exclude all movies that are in collections made in Plex. I could be using the Radarr tag to exclude movies but that is rather tedious with large libraries.
Maybe I'm doing something wrong, if so please help me out :).
To Reproduce
Create a rule with the following criteria (see screenshot):
If this rule is not supposed to work this way than this bug report should be a feature request.
Expected behavior
Created collection from rule should not contain movies which are in collections created within Plex.
Screenshots
Device (please complete the following information):
The text was updated successfully, but these errors were encountered: