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

Bugfix for listing filters with stash v0.23.1 #14

Merged
merged 2 commits into from
Nov 12, 2023

Conversation

mrbokster
Copy link
Contributor

This might not be a full fix for all changes and errors, its just what made it work for me and my filters. The filter property in the response is deprecated and split in two so there might be other issues in other parts of the plugin.

@gitgiggety gitgiggety merged commit 2f40969 into gitgiggety:develop Nov 12, 2023
1 check passed
@gitgiggety
Copy link
Owner

Thank you @mrbokster . There was just an issue with exclusions (especially when applying both an include and an exclude filter) which I fixed as well.

@mrbokster
Copy link
Contributor Author

mrbokster commented Nov 13, 2023

Thanks @gitgiggety but it crashes for me again with 0.0.8.

Seems to be in criterion_parser.py

    if 'items' in value:
        filter['value'] = list(map(lambda v: v['id'], value['items']))

needs to be something like:

        if 'items' in value and value['items'] is not None:
            filter['value'] = list(map(lambda v: v['id'], value['items']))

But done in proper python, this just makes it work for me.

The filter in question that crashes:

{'modifier': 'INCLUDES', 'value': {'depth': 0, 'excluded': [{'id': 813, 'label': 'Animated'}, {'id': 1315, 'label': 'Cock Hero'}, {'id': 496, 'label': 'Movies'}, {'id': 1034, 'label': 'PMV'}, {'id': 1316, 'label': 'Stim'}, {'id': 497, 'label': 'Compilation'}], 'items': None}}

I think thats what you tried to fix with your edit but this still crashes at the moment.

@mrbokster
Copy link
Contributor Author

mrbokster commented Nov 13, 2023

Also noticed an error in another place with this release.

stash_interface.py crashes due to a change in how the StashIDCriterionInput has changed.
For something like:

    "scene_filter": {
        "stash_id_endpoint": {
            "modifier": "IS_NULL",
            "value": ""
        }
    }

value is not longer valid and needs to be stash_id instead.

I think its due to the response from parse_criterion stores it as value which is then reused when you click on the filter but im unsure here, could be something else altogheter :)

The filter that I think crashes for me is:

      {
        "name": "Stashid missing",
        "object_filter": {
          "stash_id_endpoint": {
            "modifier": "IS_NULL"
          }
        },

This doesnt have a value in the response so im unsure where it pops up from.

@mrbokster
Copy link
Contributor Author

Im gonna open another PR instead of typing here, figured out how to fix but its most likely bad python.

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

Successfully merging this pull request may close these issues.

2 participants