[Digikam-devel] [Bug 147426] Search for non-voted pics

Arnd Baecker arnd.baecker at web.de
Fri Jul 6 11:44:09 BST 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=147426         
arnd.baecker web de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      everconfirmed|0                           |1



------- Additional Comments From arnd.baecker web de  2007-07-06 12:44 -------
Josef, you are right, now I can reproduce the problem
(not sure why I did not see it last time.
As far as I understand things, the origin of the problem is the following
search sent to the sql database

SELECT Images.id, Images.name, Images.dirid, Images.datetime, Albums.url
FROM Images, Albums LEFT JOIN ImageProperties ON Images.id =
Imageproperties.imageid WHERE (  (Images.dirid IN   (SELECT id FROM Albums
WHERE url LIKE '%Star%'))  AND  (ImageProperties.value >= '0' and
ImageProperties.property='Rating')  )  AND (Albums.id=Images.dirid);

I think that whenever an item has not yet been rated at all, ImageProperties.property='Rating' does not exist.
Setting it to some value and back to 0 creates that field in the
database so that the above AND is fulfilled.
So whenever, ImageProperties.value >= '0' or ImageProperties.value = '0'
or ImageProperties.value <= '0' is asked for, it should be presumably
something like (symbolically)

 AND ( (ImageProperties.value >= '0' and ImageProperties.property='Rating') 
       OR  (there_is_no ImageProperties.property='Rating') )

Marcel, I think a database expert is needed here ...;-) 
(i.e., can one do this somehow?)

Another option would be to define all images in the database
with rating=0...



More information about the Digikam-devel mailing list