Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package mpv-mpris for openSUSE:Factory 
checked in at 2021-11-24 23:54:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mpv-mpris (Old)
 and      /work/SRC/openSUSE:Factory/.mpv-mpris.new.1895 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mpv-mpris"

Wed Nov 24 23:54:27 2021 rev:2 rq:933396 version:0.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/mpv-mpris/mpv-mpris.changes      2020-05-19 
14:46:16.227786539 +0200
+++ /work/SRC/openSUSE:Factory/.mpv-mpris.new.1895/mpv-mpris.changes    
2021-11-24 23:54:51.512401273 +0100
@@ -1,0 +2,11 @@
+Sun Nov 21 11:43:51 UTC 2021 - Enrico Belleri <[email protected]>
+
+- Update to 0.6:
+  * Fix YouTube regex including 0 to the numeric range
+  * Fix LoopStatus property change signal
+  * Fix loop-file change handler in mpv 0.33.0
+  * Fix LoopStatus when numeric argument given to loop-file or loop-playlist
+
+  * Full changelog: https://github.com/hoyon/mpv-mpris/compare/0.5...0.6
+
+-------------------------------------------------------------------

Old:
----
  mpv-mpris-0.5.tar.gz

New:
----
  mpv-mpris-0.6.tar.gz

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

Other differences:
------------------
++++++ mpv-mpris.spec ++++++
--- /var/tmp/diff_new_pack.tQRPoa/_old  2021-11-24 23:54:52.088399340 +0100
+++ /var/tmp/diff_new_pack.tQRPoa/_new  2021-11-24 23:54:52.092399326 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package mpv-mpris
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           mpv-mpris
-Version:        0.5
+Version:        0.6
 Release:        0
 Summary:        MPRIS plugin for mpv
 License:        MIT

++++++ mpv-mpris-0.5.tar.gz -> mpv-mpris-0.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-mpris-0.5/.github/workflows/build.yml 
new/mpv-mpris-0.6/.github/workflows/build.yml
--- old/mpv-mpris-0.5/.github/workflows/build.yml       1970-01-01 
01:00:00.000000000 +0100
+++ new/mpv-mpris-0.6/.github/workflows/build.yml       2021-10-19 
22:59:59.000000000 +0200
@@ -0,0 +1,29 @@
+name: build
+
+on: [push, pull_request]
+
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Install dependencies
+        run: |
+          sudo apt update
+          sudo apt install libmpv-dev libglib2.0-dev
+
+      - name: Checkout
+        uses: actions/checkout@v2
+
+      - name: Build
+        run: |
+          make
+
+      - name: Upload binary
+        uses: actions/upload-artifact@v2
+        with:
+          name: mpris.so
+          path: mpris.so
+          if-no-files-found: error
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-mpris-0.5/Makefile new/mpv-mpris-0.6/Makefile
--- old/mpv-mpris-0.5/Makefile  2020-04-25 15:51:06.000000000 +0200
+++ new/mpv-mpris-0.6/Makefile  2021-10-19 22:59:59.000000000 +0200
@@ -1,14 +1,17 @@
 PKG_CONFIG = pkg-config
 
+INSTALL := install
+
 BASE_CFLAGS=-std=c99 -Wall -Wextra -O2 `$(PKG_CONFIG) --cflags gio-2.0 
gio-unix-2.0 glib-2.0 mpv`
 BASE_LDFLAGS=`$(PKG_CONFIG) --libs gio-2.0 gio-unix-2.0 glib-2.0`
 
+SCRIPTS_DIR := $(HOME)/.config/mpv/scripts
+
 mpris.so: mpris.c
        $(CC) mpris.c -o mpris.so $(BASE_CFLAGS) $(CFLAGS) $(BASE_LDFLAGS) 
$(LDFLAGS) -shared -fPIC
 
 install: mpris.so
-       mkdir -p $(HOME)/.config/mpv/scripts
-       cp mpris.so -t $(HOME)/.config/mpv/scripts
+       $(INSTALL) -Dt $(SCRIPTS_DIR) mpris.so
 
 clean:
        rm mpris.so
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mpv-mpris-0.5/mpris.c new/mpv-mpris-0.6/mpris.c
--- old/mpv-mpris-0.5/mpris.c   2020-04-25 15:51:06.000000000 +0200
+++ new/mpv-mpris-0.6/mpris.c   2021-10-19 22:59:59.000000000 +0200
@@ -256,7 +256,7 @@
 }
 
 static const char *youtube_url_pattern =
-    
"^https?:\\/\\/(?:youtu.be\\/|(?:www\\.)?youtube\\.com\\/watch\\?v=)(?<id>[a-zA-Z1-9_-]*)\\??.*";
+    
"^https?:\\/\\/(?:youtu.be\\/|(?:www\\.)?youtube\\.com\\/watch\\?v=)(?<id>[a-zA-Z0-9_-]*)\\??.*";
 
 static GRegex *youtube_url_regex;
 
@@ -300,20 +300,30 @@
 
 static void add_metadata_content_created(mpv_handle *mpv, GVariantDict *dict)
 {
-    char *date = mpv_get_property_string(mpv, "metadata/by-key/Date");
+    char *date_str = mpv_get_property_string(mpv, "metadata/by-key/Date");
 
-    if (!date) {
+    if (!date_str) {
         return;
     }
 
-    // Bail if date is not just the year
-    if (strlen(date) == 4) {
-        gchar *iso8601 = g_strdup_printf("%s-01-01T00:00:00Z", date);
+    GDate* date = g_date_new();
+    if (strlen(date_str) == 4) {
+        gint64 year = g_ascii_strtoll(date_str, NULL, 10);
+        if (year != 0) {
+            g_date_set_dmy(date, 1, 1, year);
+        }
+    } else {
+        g_date_set_parse(date, date_str);
+    }
+
+    if (g_date_valid(date)) {
+        gchar iso8601[20];
+        g_date_strftime(iso8601, 20, "%Y-%m-%dT00:00:00Z", date);
         g_variant_dict_insert(dict, "xesam:contentCreated", "s", iso8601);
-        g_free(iso8601);
     }
 
-    mpv_free(date);
+    g_date_free(date);
+    mpv_free(date_str);
 }
 
 static GVariant *create_metadata(UserData *ud)
@@ -849,31 +859,34 @@
 
     } else if (g_strcmp0(name, "loop-file") == 0) {
         char *status = *(char **)data;
-        if (g_strcmp0(status, "yes") == 0) {
+        if (g_strcmp0(status, "no") != 0) {
             ud->loop_status = LOOP_TRACK;
         } else {
             char *playlist_status;
             mpv_get_property(ud->mpv, "loop-playlist", MPV_FORMAT_STRING, 
&playlist_status);
-            if (g_strcmp0(playlist_status, "inf") == 0) {
+            if (g_strcmp0(playlist_status, "no") != 0) {
                 ud->loop_status = LOOP_PLAYLIST;
             } else {
                 ud->loop_status = LOOP_NONE;
             }
         }
-
+        prop_name = "LoopStatus";
+        prop_value = g_variant_new_string(ud->loop_status);
     } else if (g_strcmp0(name, "loop-playlist") == 0) {
         char *status = *(char **)data;
-        if (g_strcmp0(status, "inf") == 0) {
+        if (g_strcmp0(status, "no") != 0) {
             ud->loop_status = LOOP_PLAYLIST;
         } else {
             char *file_status;
             mpv_get_property(ud->mpv, "loop-file", MPV_FORMAT_STRING, 
&file_status);
-            if (g_strcmp0(file_status, "yes") == 0) {
+            if (g_strcmp0(file_status, "no") != 0) {
                 ud->loop_status = LOOP_TRACK;
             } else {
                 ud->loop_status = LOOP_NONE;
             }
         }
+        prop_name = "LoopStatus";
+        prop_value = g_variant_new_string(ud->loop_status);
     }
 
     if (prop_name) {
@@ -930,7 +943,7 @@
 
 static void wakeup_handler(void *fd)
 {
-    write(*((int*)fd), "0", 1);
+    (void)!write(*((int*)fd), "0", 1);
 }
 
 // Plugin entry point

Reply via email to