[pitivi] medialibrary.py: Check ~/.cache/thumbnails for thumbnails.



commit bd5f69663e5556539e2b0ae0fe9e0a3bc6bcb00e
Author: namanyadav12 <namanyadav128 gmail com>
Date:   Wed Feb 8 18:01:44 2017 +0000

    medialibrary.py: Check ~/.cache/thumbnails for thumbnails.
    
    Currently __get_thumbnails_from_xdg_cache function checks for
    thumbnails in ~/.cache/thumbnailnormal and ~/.cache/thumbnaillarge
    directories  due to bugs. It should check in
    ~/.cache/thumbnails/normal and ~/.cache/thumnails/large.
    
    Differential Revision: https://phabricator.freedesktop.org/D1648

 pitivi/medialibrary.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index 9d63401..1dd016f 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -265,8 +265,8 @@ class AssetThumbnail(Loggable):
         """
         quoted_uri = quote_uri(real_uri)
         thumbnail_hash = md5(quoted_uri.encode()).hexdigest()
-        thumb_dir = os.path.join(GLib.get_user_cache_dir(), "thumbnail")
-        path_128 = thumb_dir + "normal/" + thumbnail_hash + ".png"
+        thumb_dir = os.path.join(GLib.get_user_cache_dir(), "thumbnails")
+        path_128 = os.path.join(thumb_dir, "normal", thumbnail_hash + ".png")
         interpolation = GdkPixbuf.InterpType.BILINEAR
 
         # The cache dirs might have resolutions of 256 and/or 128,
@@ -279,7 +279,7 @@ class AssetThumbnail(Loggable):
             return small_thumb, large_thumb
         except GLib.GError:
             # path_128 doesn't exist, try the 256 version.
-            path_256 = thumb_dir + "large/" + thumbnail_hash + ".png"
+            path_256 = os.path.join(thumb_dir, "large", thumbnail_hash + ".png")
             try:
                 thumb_256 = GdkPixbuf.Pixbuf.new_from_file(path_256)
                 w, h = thumb_256.get_width(), thumb_256.get_height()


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