Officially we don't recommend users manipulate the database directly. If you do, I highly recommend working on copies of both of them. You have to be a little careful that the Photo IDs correspond to the same photo in both databases -- it's possible that they do not, depending on how the database was used after the backup snapshot was taken. You might consider matching on filename rather than ID.
-- Jim

On Sat, Aug 31, 2013 at 12:21 AM, Xavier Thibert <[email protected]> wrote:

Dear all,
This question is about manipulation of the database "photo.db" of the program Shotwell.

For some reason I have lost my rating on many pictures 10 000 range. It was probably a mistake of mine. I have an old backup of the database that I will call "oldPhoto.db". Since I have lost my rating I did a lot of new rating, importation, and many open and closing of shotwell, so I cannot just use the "photo.db.bak". I don't want to replace "Photo.db" by "oldPhoto.db" and lose the new work. I realized that the database is a SQL (I don't know it, but I know how powerful it is). For a knowledgeable person I think it is a 15 liner problem or such. What I want to do is in pseudo code bwlow.


#-------------------------------------------------------------------------------------
foreach [id in photo.db-PhotoTable]{
    x= the rating associate with id
    if [ x==0 ]{
       y= the rating of  oldPhoto.db-PhotoTable-same id as above
       if [ y > x ]{
           x=y
           write the new x in photo.db rating of corresponding id
       }
} }
save photo.db
#-----------------------------------------------------------------------------------------

Best regards,
_______________________________________________
Shotwell mailing list
[email protected]
http://lists.yorba.org/cgi-bin/mailman/listinfo/shotwell

_______________________________________________
Shotwell mailing list
[email protected]
http://lists.yorba.org/cgi-bin/mailman/listinfo/shotwell

Reply via email to