Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package QMPlay2 for openSUSE:Factory checked 
in at 2021-10-13 18:06:29
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/QMPlay2 (Old)
 and      /work/SRC/openSUSE:Factory/.QMPlay2.new.2443 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "QMPlay2"

Wed Oct 13 18:06:29 2021 rev:58 rq:925090 version:21.06.07

Changes:
--------
--- /work/SRC/openSUSE:Factory/QMPlay2/QMPlay2.changes  2021-07-29 
21:33:13.604677766 +0200
+++ /work/SRC/openSUSE:Factory/.QMPlay2.new.2443/QMPlay2.changes        
2021-10-13 18:11:19.959767988 +0200
@@ -1,0 +2,6 @@
+Wed Oct 13 08:50:32 UTC 2021 - Simon Vogl <[email protected]>
+
+- Added 0001-switch-to-yt-dlp.patch to fix several youtube-dl related issues 
such as buffering being unreliable
+- Optimized spec file formatting for more compactness
+
+-------------------------------------------------------------------

New:
----
  0001-switch-to-yt-dlp.patch

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

Other differences:
------------------
++++++ QMPlay2.spec ++++++
--- /var/tmp/diff_new_pack.xTcUh7/_old  2021-10-13 18:11:20.367768628 +0200
+++ /var/tmp/diff_new_pack.xTcUh7/_new  2021-10-13 18:11:20.371768634 +0200
@@ -15,6 +15,7 @@
 # Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
+
 %define __builder Ninja
 
 Name:             QMPlay2
@@ -27,6 +28,8 @@
 Source:           
https://github.com/zaps166/QMPlay2/releases/download/%{version}/QMPlay2-src-%{version}.tar.xz
 # PATCH-FEATURE-OPENSUSE
 Patch1:           0001-add-opensuse-customizations.patch
+# PATCH-FIX-UPSTREAM
+Patch2:         0001-switch-to-yt-dlp.patch
 BuildRequires:    cmake >= 3.16
 BuildRequires:    gcc-c++
 # Use gcc 10 for openSUSE Leap 15.3+ and SLE15SP3+

++++++ 0001-switch-to-yt-dlp.patch ++++++
>From 60c0a63c35afc5a8c95f0b94292500644abcfe41 Wed 13 10 08:50:32 2021
From: Simon Vogl <[email protected]>
Date: Wed, 13 Oct 2021 08:50:32 UTC
Subject: [PATCH] Make QMPlay2 use yt-dlp instead of youtube-dl

This patch makes QMPlay2 use yt-dlp instead of youtube-dl.
The switch adresses several issues such as buffering not working correctly.

--- a/src/qmplay2/YouTubeDL.cpp
+++ b/src/qmplay2/YouTubeDL.cpp
@@ -22,6 +22,7 @@
 #include <QMPlay2Core.hpp>
 #include <Functions.hpp>
 
+#include <QRegularExpression>
 #include <QStandardPaths>
 #include <QJsonDocument>
 #include <QJsonObject>
@@ -36,9 +37,9 @@ static QMutex g_mutex(QMutex::Recursive);
 
 QString YouTubeDL::getFilePath()
 {
-    return QMPlay2Core.getSettingsDir() + "youtube-dl"
+    return QMPlay2Core.getSettingsDir() + "yt-dlp"
 #ifdef Q_OS_WIN
-    ".exe"
+    "_x86.exe"
 #endif
     ;
 }
@@ -305,9 +306,9 @@ bool YouTubeDL::download()
 {
     // Mutex must be locked here
 
-    const QString downloadUrl = "https://yt-dl.org/downloads/latest/youtube-dl";
+    const QString downloadUrl = 
"https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp";
 #ifdef Q_OS_WIN
-    ".exe"
+    "_x86.exe"
 #endif
     ;
 
@@ -389,29 +390,11 @@ bool YouTubeDL::update()
         {
             qCritical() << "youtube-dl update failed:" << updateOutput;
         }
-        else if (m_process.exitCode() == 0 && 
!updateOutput.contains("up-to-date"))
+        else if (m_process.exitCode() == 0 && 
!updateOutput.contains(QRegularExpression(R"(up\Wto\Wdate)")))
         {
-#ifdef Q_OS_WIN
-            const QString updatedFile = m_ytDlPath + ".new";
-            QFile::remove(Functions::filePath(m_ytDlPath) + 
"youtube-dl-updater.bat");
-            if (QFile::exists(updatedFile))
-            {
-                Functions::s_wait(0.2); // Wait 200 ms to be sure that file is 
closed
-                QFile::remove(m_ytDlPath);
-                if (QFile::rename(updatedFile, m_ytDlPath))
-                {
-#endif
-                    QMPlay2Core.setWorking(false);
-                    emit QMPlay2Core.sendMessage(tr("\"youtube-dl\" has been 
successfully updated!"), g_name);
-                    return true;
-#ifdef Q_OS_WIN
-                }
-            }
-            else
-            {
-                qDebug() << "Updated youtube-dl file:" + updatedFile + "not 
found!";
-            }
-#endif
+            QMPlay2Core.setWorking(false);
+            emit QMPlay2Core.sendMessage(tr("\"youtube-dl\" has been 
successfully updated!"), g_name);
+            return true;
         }
     }
     else if (updating && m_aborted)

Reply via email to