kannibalox / pyrosimple

An overhauled fork of the pyrocore tools for rTorrent
https://kannibalox.github.io/pyrosimple/
GNU General Public License v3.0
48 stars 5 forks source link

Inverse conditions do not match documentation #13

Closed BristleBeard closed 1 year ago

BristleBeard commented 1 year ago

I have a group of incomplete items that I'm using to test tag filtering. All incomplete items have been tagged with testtag.

rtcontrol is_complete=no tagged=\!'testtag' -o tagged,name -q works and no results are returned (as expected). rtcontrol is_complete=no tagged!='testtag' -o tagged,name -q returns all incomplete items including testtag items. rtcontrol is_complete=no 'tagged!=testtag' -o tagged,name -q returns all incomplete items including testtag items.

The last two are puzzling because I thought when multiple filters are used it defaults to AND but it's behaving as if it's OR. rtcontrol tagged="" doesn't appear to work as documented but rtcontrol tagged=\"\" does.

kannibalox commented 1 year ago

tagged=\!'testtag' was working for you unintentionally, it checks for the literal tag !testtag, which naturally doesn't exist. tagged!='testtag' and 'tagged!=testtag' are parsed to the same thing, which should work as expected now.

The docs have been updated with properly escaped values, thanks.

BristleBeard commented 1 year ago

Looking good now, but I think you may have left some debug code turned on. Any queries using tagged as a filter results in seeing a True or False at the beginning of the output even with a -q switch.

kannibalox commented 1 year ago

Shoot, thanks for pointing that out. Fixed in https://github.com/kannibalox/pyrosimple/commit/9aeaf7f357972b8b52172b418f7bb3bf97d7be48.