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 filter listing when items is null #15

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

mrbokster
Copy link
Contributor

Fix for listing of filter with items None

{'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}}

Fix for opening of filters that have no value

      {
        "name": "Stashid missing",
        "object_filter": {
          "stash_id_endpoint": {
            "modifier": "IS_NULL"
          }
        },
        "find_filter": {
          "q": "",
          "page": 1,
          "per_page": 40,
          "sort": "date",
          "direction": "ASC"
        }
      },

Copy link
Owner

@gitgiggety gitgiggety left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of sorry for modifying your original PR and breaking it once more. (This does show it's important to include the criterion(s) / graphql result in the bug so I'm not making the wrong assumptions about criterions which are broken. So if you notice any other issues please try to include the criterion / graphql result.)

I've added two small comments. If you can make those changes I think it will be fine to merge.

resources/lib/criterion_parser.py Outdated Show resolved Hide resolved
resources/lib/criterion_parser.py Outdated Show resolved Hide resolved
@gitgiggety
Copy link
Owner

@mrbokster, I made the changes (on your branch), can you check these work for you? I did test they work for me

@gitgiggety gitgiggety force-pushed the bugfix/filter-listing branch from ec37964 to 179bbf7 Compare November 14, 2023 16:01
* Fix handling of both missing and null/None values for includes / excludes
* Handle criterions without values
@mrbokster
Copy link
Contributor Author

Looks good to me and all works on my end as well. No worries about breaking it, im very thankful you created it to begin with and I like coding but have no experience with Python so was fun to have a look at that as well.

Cheers

@mrbokster mrbokster closed this Nov 14, 2023
@mrbokster mrbokster reopened this Nov 14, 2023
Copy link
Contributor Author

@mrbokster mrbokster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cant approve it so just leaving a comment, looks good and works on my end.

@gitgiggety gitgiggety merged commit a1a04a2 into gitgiggety:develop Nov 14, 2023
2 checks passed
@gitgiggety
Copy link
Owner

Well, apparently I still didn't test properly. These changes broke all other (simple?) is_null filters like "URL is null" or "date is null" etc. So I implemented a separate fix for stash_id_endpoint.

Furthermore the "list" handling only worked when depth was set, and didn't properly handle scenarios where it wasn't set (i.e.: it did work for all variants of "tags", but didn't work for any variant of "performer" anymore). All of this should be fixed on the develop branch now. (Which furthermore fixes an older bug where "created / updated at" containing a time didn't work properly. But that's an "old" issue). So after some confirmation of this working I will make another release.

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