[pitivi/ges] thumbnailer: Make it possible to replace a thumbnail



commit 7995c072fad6491099c572e1106b364272ef3820
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Mon May 14 13:07:47 2012 -0400

    thumbnailer: Make it possible to replace a thumbnail

 pitivi/timeline/thumbnailer.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/timeline/thumbnailer.py b/pitivi/timeline/thumbnailer.py
index f5f1077..cc82762 100644
--- a/pitivi/timeline/thumbnailer.py
+++ b/pitivi/timeline/thumbnailer.py
@@ -177,6 +177,8 @@ class ThumbnailCache(object):
         self.cache[key] = value
         self.queue.append(key)
         blob = sqlite3.Binary(bytearray(value.get_data()))
+        #Replace if the key already existed
+        self.cur.execute("DELETE FROM Thumbs WHERE  time=?", (key,))
         self.cur.execute("INSERT INTO Thumbs VALUES (?,?,?,?)", (key, blob, value.get_width(), value.get_height()))
         self.conn.commit()
         if len(self.cache) > self.size:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]