Hello community,

here is the log from the commit of package lua-lua-mpris for openSUSE:Factory 
checked in at 2019-10-27 13:41:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/lua-lua-mpris (Old)
 and      /work/SRC/openSUSE:Factory/.lua-lua-mpris.new.2990 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "lua-lua-mpris"

Sun Oct 27 13:41:08 2019 rev:9 rq:742984 version:0.0+git20191025.2b12542

Changes:
--------
--- /work/SRC/openSUSE:Factory/lua-lua-mpris/lua-lua-mpris.changes      
2019-06-14 20:43:11.890311678 +0200
+++ /work/SRC/openSUSE:Factory/.lua-lua-mpris.new.2990/lua-lua-mpris.changes    
2019-10-27 13:41:13.849282671 +0100
@@ -1,0 +2,7 @@
+Fri Oct 25 16:54:12 UTC 2019 - [email protected]
+
+- Update to version 0.0+git20191025.2b12542:
+  * Set correct values for SupportedMimeTypes and SupportedUriSchemes 
properties
+  This fixes the plugin to work correctly with KDE Plasma 5.17 .
+
+-------------------------------------------------------------------

Old:
----
  lua-mpris-0.0+git20190614.e4567e2.tar.xz

New:
----
  lua-mpris-0.0+git20191025.2b12542.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ lua-lua-mpris.spec ++++++
--- /var/tmp/diff_new_pack.cmoNs4/_old  2019-10-27 13:41:15.017284079 +0100
+++ /var/tmp/diff_new_pack.cmoNs4/_new  2019-10-27 13:41:15.021284084 +0100
@@ -19,7 +19,7 @@
 %define flavor @BUILD_FLAVOR@
 %define mod_name lua-mpris
 %define mpv_lua_flavor lua51
-Version:        0.0+git20190614.e4567e2
+Version:        0.0+git20191025.2b12542
 Release:        0
 Summary:        MPRIS api for lua
 License:        MIT

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.cmoNs4/_old  2019-10-27 13:41:15.061284132 +0100
+++ /var/tmp/diff_new_pack.cmoNs4/_new  2019-10-27 13:41:15.061284132 +0100
@@ -1,4 +1,4 @@
 <servicedata>
 <service name="tar_scm">
                 <param name="url">https://github.com/antlarr/lua-mpris</param>
-              <param 
name="changesrevision">e4567e27986cccbdf01de0ec82dff489475099c9</param></service></servicedata>
+              <param 
name="changesrevision">2b12542d29f8f5f366a1dc047a82ee65bd735b41</param></service></servicedata>
\ No newline at end of file

++++++ lua-mpris-0.0+git20190614.e4567e2.tar.xz -> 
lua-mpris-0.0+git20191025.2b12542.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lua-mpris-0.0+git20190614.e4567e2/mpv.lua 
new/lua-mpris-0.0+git20191025.2b12542/mpv.lua
--- old/lua-mpris-0.0+git20190614.e4567e2/mpv.lua       2019-06-14 
13:57:17.000000000 +0200
+++ new/lua-mpris-0.0+git20191025.2b12542/mpv.lua       2019-10-25 
18:48:50.000000000 +0200
@@ -84,6 +84,75 @@
 
 local cover_filenames = {'cover.jpg', 'cover.png', 'folder.jpg', 'folder.png', 
'front.jpg', 'front.png'}
 
+local demuxer_to_mimetype = {
+ aac="audio/aac",
+ ac3="audio/ac3",
+ flac="audio/flac",
+ m4a="audio/mp4",
+ mov="video/quicktime",
+ mp4={"audio/mp4","video/mp4"},
+ m4a="audio/mp4",
+ mj2="video/mj2",
+ mp3="audio/mpeg",
+ ogg={"audio/ogg", "video/ogg", "video/x-ogm+ogg", "video/x-theora+ogg"},
+ webm={"audio/webm", "video/webm"},
+ aiff="audio/x-aiff",
+ ape="audio/x-ape",
+ gsm="audio/x-gsm",
+ xwma="audio/x-ms-wma",
+ mpc="audio/x-musepack",
+ wav="audio/x-wav",
+ wv="audio/x-wavpack",
+ dv="video/dv",
+ m4v="video/mp4",
+ mpeg="video/mpeg",
+ flv="video/x-flv",
+ matroska="video/x-matroska",
+ mjpeg="video/x-mjpeg",
+ avi="video/x-msvideo",
+ }
+demuxer_to_mimetype["3gp"]="video/3gpp"
+demuxer_to_mimetype["3g2"]="video/3gpp2"
+
+function split(str, pat)
+   local t = {}  -- NOTE: use {n = 0} in Lua-5.0
+   local fpat = "(.-)" .. pat
+   local last_end = 1
+   local s, e, cap = str:find(fpat, 1)
+   while s do
+      if s ~= 1 or cap ~= "" then
+         table.insert(t,cap)
+      end
+      last_end = e+1
+      s, e, cap = str:find(fpat, last_end)
+   end
+   if last_end <= #str then
+      cap = str:sub(last_end)
+      table.insert(t, cap)
+   end
+   return t
+end
+
+function get_supported_mimetypes()
+   mimetypes = {}
+   demuxers = mp.get_property_native('demuxer-lavf-list')
+   for _, v in pairs(demuxers) do
+       for _, d in pairs(split(v, ",")) do
+            mime = demuxer_to_mimetype[d]
+            if mime then
+               if type(mime) == 'table' then
+                   for _, mimeit in pairs(mime) do
+                        table.insert(mimetypes, mimeit)
+                    end
+               else
+                    table.insert(mimetypes, mime)
+               end
+            end
+       end
+   end
+   return mimetypes
+end
+
 --- sync
 
 mp.add_periodic_timer(0.1, function () mpris.dbus.poll() end)
@@ -271,5 +340,8 @@
 mpris.property:set('setfullscreen', true)
 
 
-mpris.property:set('urischemes', mp.get_protocols and mp.get_protocols() or {})
-mpris.property:set('mimetypes', mp.get_mimetypes and mp.get_mimetypes() or {}) 
-- TODO
+
+protocol_list = mp.get_property_native('protocol-list')
+supported_mimetypes = get_supported_mimetypes()
+mpris.property:set('urischemes', protocol_list or {})
+mpris.property:set('mimetypes', supported_mimetypes or {})


Reply via email to