remcoboerma / jbrout

Automatically exported from code.google.com/p/jbrout
0 stars 0 forks source link

Search with rating = 0 search all pictures #207

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use the search tab in jbrout
2. Enter an album name
3. Select rating "=0"
4. Validate

What is the expected output? What do you see instead?
I expected to get the pictures with rating = 0 (or no rating) in the album (and 
subalbums), instead, I got *all* pictures in db with rating = 0. 

What version of the product are you using? On what operating system?
Jbrout svn checkout at r340, on Linux Ubuntu 12.04

Please provide any additional information below.

Found bug in jbrout.py: since the test on rating = 0 is in fact rating = 0 or 
no rating, it would need parenthesis. It seems I got an expression like: 
    album = 'xxxxx' and not rated or rating = 0   
instead of: 
    album = 'xxxxx' and (not rated or rating = 0)

I can't give a real patch, since my jbrout has other modifs (load/export basket 
functionality): but the correction is simple enough: 

Index: jbrout.py
===================================================================
--- jbrout.py   (révision 340)
+++ jbrout.py   (copie de travail)
@@ -3042,7 +3123,7 @@
             op = u"r%s" % t
             if t.find("=0")>-1 or t.find("<")>-1:
                 # to find rating zero, include missing db <r> tag
-                op = u"not(r) or " + op
+                op = u"(not(r) or " + op + ")"
             ops.append( op )
             tops.append( _(u"Rating:%s") % t )

Original issue reported on code.google.com by chartier...@gmail.com on 15 Sep 2012 at 12:04

GoogleCodeExporter commented 9 years ago

Original comment by r...@wallace.gen.nz on 4 Oct 2012 at 5:47

GoogleCodeExporter commented 9 years ago
Fixed in r341

Original comment by r...@wallace.gen.nz on 4 Oct 2012 at 7:12