[pitivi] medialibrary: Remove scaled proxy option for audio files



commit 0e74eb3aa82d38506f1a2f5e6c472935a780c272
Author: Ritwik Puri <ritwikpuri5678 gmail com>
Date:   Thu Feb 6 01:37:29 2020 +0530

    medialibrary: Remove scaled proxy option for audio files

 pitivi/medialibrary.py | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index 8ed8f5e5..14034afd 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -1360,6 +1360,13 @@ class MediaLibraryWidget(Gtk.Box, Loggable):
         if len(assets) == len(image_assets):
             return menu_model, action_group
 
+        video_streams = []
+        for asset in assets:
+            video_streams += [
+                stream_info
+                for stream_info in asset.get_info().get_stream_list()
+                if isinstance(stream_info, GstPbutils.DiscovererVideoInfo)]
+
         proxies = [asset.get_proxy_target() for asset in assets
                    if self.app.proxy_manager.is_proxy_asset(asset)]
         hq_proxies = [asset.get_proxy_target() for asset in assets
@@ -1445,14 +1452,15 @@ class MediaLibraryWidget(Gtk.Box, Loggable):
             menu_model.append(text, "assets.%s" %
                               action.get_name().replace(" ", "."))
 
-            action = Gio.SimpleAction.new("use-scaled-proxies", None)
-            action.connect("activate", self.__use_scaled_proxies_cb)
-            action_group.insert(action)
-            text = ngettext("Use Scaled Proxy for selected asset",
-                            "Use Scaled Proxies for selected assets", len(assets))
+            if video_streams:
+                action = Gio.SimpleAction.new("use-scaled-proxies", None)
+                action.connect("activate", self.__use_scaled_proxies_cb)
+                action_group.insert(action)
+                text = ngettext("Use Scaled Proxy for selected asset",
+                                "Use Scaled Proxies for selected assets", len(assets))
 
-            menu_model.append(text, "assets.%s" %
-                              action.get_name().replace(" ", "."))
+                menu_model.append(text, "assets.%s" %
+                                  action.get_name().replace(" ", "."))
 
         return menu_model, action_group
 


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