Date: Friday, April 21, 2023 @ 18:32:42 Author: arojas Revision: 475082
upgpkg: audiotube 23.04.0-2: Backport fixes to actually make it work (FS#78277) Added: audiotube/trunk/58460cf3.patch Modified: audiotube/trunk/PKGBUILD ----------------+ 58460cf3.patch | 161 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ PKGBUILD | 19 +++++- 2 files changed, 177 insertions(+), 3 deletions(-) Added: 58460cf3.patch =================================================================== --- 58460cf3.patch (rev 0) +++ 58460cf3.patch 2023-04-21 18:32:42 UTC (rev 475082) @@ -0,0 +1,161 @@ +From 58460cf3d72e5f799ed606169e8410beaee5820f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonah=20Br=C3=BCchert?= <[email protected]> +Date: Wed, 12 Apr 2023 12:13:26 +0200 +Subject: [PATCH] Add support for ytmusicapi 1.0.0 + +--- + flatpak/python3-yt-dlp.json | 4 ++-- + flatpak/python3-ytmusicapi.json | 8 ++++---- + requirements.txt | 2 +- + src/example/main.cpp | 2 +- + src/ytmusic.cpp | 12 ++++++++---- + src/ytmusic.h | 6 +++--- + 6 files changed, 19 insertions(+), 15 deletions(-) + +diff --git a/flatpak/python3-yt-dlp.json b/flatpak/python3-yt-dlp.json +index 46aeb1bf..fdab9485 100644 +--- a/flatpak/python3-yt-dlp.json ++++ b/flatpak/python3-yt-dlp.json +@@ -27,8 +27,8 @@ + }, + { + "type": "file", +- "url": "https://files.pythonhosted.org/packages/85/dc/549a807a53c13fd4a8dac286f117a7a71260defea9ec0c05d6027f2ae273/websockets-10.4.tar.gz", +- "sha256": "eef610b23933c54d5d921c92578ae5f89813438fded840c2e9809d378dc765d3" ++ "url": "https://files.pythonhosted.org/packages/bd/90/6b5802fad3992d6eac7163216e0389a72475cbb57b23005135190e96d160/websockets-11.0.1.tar.gz", ++ "sha256": "369410925b240b30ef1c1deadbd6331e9cd865ad0b8966bf31e276cc8e0da159" + }, + { + "type": "file", +diff --git a/flatpak/python3-ytmusicapi.json b/flatpak/python3-ytmusicapi.json +index dfe19f06..f13e5794 100644 +--- a/flatpak/python3-ytmusicapi.json ++++ b/flatpak/python3-ytmusicapi.json +@@ -27,13 +27,13 @@ + }, + { + "type": "file", +- "url": "https://files.pythonhosted.org/packages/fe/ca/466766e20b767ddb9b951202542310cba37ea5f2d792dae7589f1741af58/urllib3-1.26.14-py2.py3-none-any.whl", +- "sha256": "75edcdc2f7d85b137124a6c3c9fc3933cdeaa12ecb9a6a959f22797a0feca7e1" ++ "url": "https://files.pythonhosted.org/packages/7b/f5/890a0baca17a61c1f92f72b81d3c31523c99bec609e60c292ea55b387ae8/urllib3-1.26.15-py2.py3-none-any.whl", ++ "sha256": "aa751d169e23c7479ce47a0cb0da579e3ede798f994f5816a74e4f4500dcea42" + }, + { + "type": "file", +- "url": "https://files.pythonhosted.org/packages/14/a9/5ba638ca601c74f169e0e0b055526566f2fa6b6402233a29aba607dca58e/ytmusicapi-0.25.0-py3-none-any.whl", +- "sha256": "be355bb3409c0e6c25a95ffd92213bd216561cdd8a0493a36a82d1726ff6efb9" ++ "url": "https://files.pythonhosted.org/packages/0a/74/fee0f00aa3205662c12bf216f609b713ed015695476c60416127871d476c/ytmusicapi-1.0.0-py3-none-any.whl", ++ "sha256": "769f4ac9fc90b59e9bdb2cc5ef1e9829dd0a7b1ff1a246007b6c738770fce939" + } + ] + } +\ No newline at end of file +diff --git a/requirements.txt b/requirements.txt +index a83e7de4..67bdfa47 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -3,5 +3,5 @@ + # + # SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL + +-ytmusicapi==0.25.0 ++ytmusicapi==1.0.0 + yt-dlp +diff --git a/src/example/main.cpp b/src/example/main.cpp +index 8e936f41..2f95c849 100644 +--- a/src/example/main.cpp ++++ b/src/example/main.cpp +@@ -8,7 +8,7 @@ + + int main() { + const auto ytm = YTMusic(); +- const auto results = ytm.search("the french dispatch"); ++ const auto results = ytm.search("Saint Motel"); + + std::cout << "Found " << results.size() << " results." << std::endl; + +diff --git a/src/ytmusic.cpp b/src/ytmusic.cpp +index 68c3c8ec..4ee9f31b 100644 +--- a/src/ytmusic.cpp ++++ b/src/ytmusic.cpp +@@ -22,7 +22,7 @@ void pyPrintPretty(py::handle obj) { + + #define UNEXPORT __attribute__ ((visibility("hidden"))) + +-constexpr auto TESTED_YTMUSICAPI_VERSION = "0.25.0"; ++constexpr auto TESTED_YTMUSICAPI_VERSION = "1.0.0"; + + struct UNEXPORT YTMusicPrivate { + py::scoped_interpreter guard {}; +@@ -135,7 +135,7 @@ inline auto extract_py_list(py::handle obj) { + + album::Track extract_album_track(py::handle track) { + return { +- track["isExplicit"].cast<bool>(), ++ optional_key<bool>(track, "isExplicit"), + track["title"].cast<std::string>(), + extract_py_list<meta::Artist>(track["artists"]), + track["album"].cast<std::optional<std::string>>(), +@@ -201,7 +201,7 @@ playlist::Track extract_playlist_track(py::handle track) { + track["likeStatus"].cast<std::optional<std::string>>(), + extract_py_list<meta::Thumbnail>(track["thumbnails"]), + track["isAvailable"].cast<bool>(), +- track["isExplicit"].cast<bool>() ++ optional_key<bool>(track, "isExplicit") + }; + } + +@@ -277,6 +277,10 @@ std::optional<artist::Artist::Section<T>> extract_artist_section(py::handle arti + std::optional<search::SearchResultItem> extract_search_result(py::handle result) { + const auto resultType = result["resultType"].cast<std::string>(); + ++ if (result["category"].cast<std::optional<std::string>>() == "Top result") { ++ return {}; ++ } ++ + if (resultType == "video") { + return search::Video { + { +@@ -298,7 +302,7 @@ std::optional<search::SearchResultItem> extract_search_result(py::handle result) + extract_py_list<meta::Thumbnail>(result["thumbnails"]) + }, + result["album"].is_none() ? std::optional<meta::Album> {} : extract_meta_album(result["album"]), +- result["isExplicit"].cast<bool>() ++ optional_key<bool>(result, "isExplicit") + }; + } else if (resultType == "album") { + return search::Album { +diff --git a/src/ytmusic.h b/src/ytmusic.h +index 2449fabb..77834813 100644 +--- a/src/ytmusic.h ++++ b/src/ytmusic.h +@@ -61,7 +61,7 @@ struct Playlist { + + struct Song : public Media { + std::optional<meta::Album> album; +- bool is_explicit; ++ std::optional<bool> is_explicit; + }; + + struct Album { +@@ -147,7 +147,7 @@ struct Artist { + + namespace album { + struct Track { +- bool is_explicit; ++ std::optional<bool> is_explicit; + std::string title; + std::vector<meta::Artist> artists; + std::optional<std::string> album; +@@ -216,7 +216,7 @@ struct Track { + std::optional<std::string> like_status; + std::vector<meta::Thumbnail> thumbnails; + bool is_available; +- bool is_explicit; ++ std::optional<bool> is_explicit; + }; + + struct Playlist { +-- +GitLab + Modified: PKGBUILD =================================================================== --- PKGBUILD 2023-04-21 18:14:42 UTC (rev 475081) +++ PKGBUILD 2023-04-21 18:32:42 UTC (rev 475082) @@ -2,7 +2,7 @@ pkgname=audiotube pkgver=23.04.0 -pkgrel=1 +pkgrel=2 pkgdesc='Client for YouTube Music' url='https://apps.kde.org/audiotube/' arch=(x86_64) @@ -10,13 +10,26 @@ groups=(kde-applications kde-multimedia) depends=(kirigami-addons qt5-svg ki18n kcrash kwindowsystem yt-dlp python-ytmusicapi) makedepends=(extra-cmake-modules pybind11 python) -source=(https://download.kde.org/stable/release-service/$pkgver/src/$pkgname-$pkgver.tar.xz{,.sig}) +source=(https://download.kde.org/stable/release-service/$pkgver/src/$pkgname-$pkgver.tar.xz{,.sig} + https://invent.kde.org/multimedia/audiotube/-/commit/090129d9.patch + https://invent.kde.org/multimedia/audiotube/-/commit/bb4a24e2.patch + https://invent.kde.org/multimedia/audiotube/-/commit/58460cf3.patch) sha256sums=('b122b887e0c87a3bb9779e322f35c4beb548a4457d4dc8a4ad64fc26955e9d51' - 'SKIP') + 'SKIP' + '8061d24d0b94554f320efeeac2019a7ff5d44b957b6837e5a912bdbfda604936' + '78bd847cc9998c83cd8d011670684d76c64e4bda3e088b33651bb6eac7b30e6f' + 'f877eb4d9c061e367e3dda8ef3efa73a877e01407e6c8386cbdb67cc1d7d148d') validpgpkeys=(CA262C6C83DE4D2FB28A332A3A6A4DB839EAA6D7 # Albert Astals Cid <[email protected]> F23275E4BF10AFC1DF6914A6DBD2CE893E2D1C87 # Christoph Feck <[email protected]> D81C0CB38EB725EF6691C385BB463350D6EF31EF) # Heiko Becker <[email protected]> +prepare() { +# Backport bug fixes + patch -d $pkgname-$pkgver -p1 < 090129d9.patch + patch -d $pkgname-$pkgver -p1 < bb4a24e2.patch + patch -d $pkgname-$pkgver -p1 < 58460cf3.patch +} + build() { cmake -B build -S $pkgname-$pkgver \ -DBUILD_TESTING=OFF
