[pitivi] medialibrary: Disable force-proxy option for image assets.



commit f26ff31b1e383e0fd009f444d51234a27d2a739a
Author: ymdatta <ymdatta protonmail com>
Date:   Mon Dec 10 21:38:48 2018 +0530

    medialibrary: Disable force-proxy option for image assets.
    
    Disables force-proxy option for image assets, also if multiple
    assets were selected and proxied together, then the proxying is
    done only for non-image files, if any.
    
    Fixes #2181

 pitivi/medialibrary.py | 8 +++++++-
 pitivi/project.py      | 6 ++++--
 2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index e3ebc00f..1c525d78 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -1199,6 +1199,12 @@ class MediaLibraryWidget(Gtk.Box, Loggable):
             text = _("Open containing folder")
             menu_model.append(text, "assets.%s" % action.get_name().replace(" ", "."))
 
+        image_assets = [asset for asset in assets
+                        if asset.is_image()]
+
+        if len(assets) == len(image_assets):
+            return menu_model, action_group
+
         proxies = [asset.get_proxy_target() for asset in assets
                    if self.app.proxy_manager.is_proxy_asset(asset)]
         in_progress = [asset.creation_progress for asset in assets
@@ -1255,7 +1261,7 @@ class MediaLibraryWidget(Gtk.Box, Loggable):
                     selection.select_path(path)
 
         model, action_group = self.__createMenuModel()
-        if not model:
+        if not model or not model.get_n_items():
             return True
 
         popover = Gtk.Popover.new_from_model(view, model)
diff --git a/pitivi/project.py b/pitivi/project.py
index 5ed923f1..984a540a 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -1516,8 +1516,10 @@ class Project(Loggable, GES.Project):
                               " its recreation")
                     target.unproxy(asset)
 
-                # The asset is not a proxy.
-                originals.append(asset)
+                if not asset.is_image():
+                    # The asset is not a proxy and not an image.
+                    originals.append(asset)
+
         if originals:
             with self.app.action_log.started("Proxying assets"):
                 for asset in originals:


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