From d9142feddd9910581331a29f1e6553dd5a4aeec4 Mon Sep 17 00:00:00 2001 From: kashw2 Date: Sat, 29 Jun 2024 18:15:47 +1000 Subject: [PATCH] spotdl: added patch for `syncedlyrics.utils` build failure --- pkgs/tools/audio/spotdl/default.nix | 3 + .../audio/spotdl/is_lrc_valid-failure.patch | 65 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 pkgs/tools/audio/spotdl/is_lrc_valid-failure.patch diff --git a/pkgs/tools/audio/spotdl/default.nix b/pkgs/tools/audio/spotdl/default.nix index 3e252f2313b4..68235ab3d469 100644 --- a/pkgs/tools/audio/spotdl/default.nix +++ b/pkgs/tools/audio/spotdl/default.nix @@ -22,6 +22,9 @@ python3.pkgs.buildPythonApplication rec { pythonRelaxDeps = true; + # Remove when https://github.com/spotDL/spotify-downloader/issues/2119 is fixed + patches = [ ./is_lrc_valid-failure.patch ]; + dependencies = with python3.pkgs; [ bandcamp-api beautifulsoup4 diff --git a/pkgs/tools/audio/spotdl/is_lrc_valid-failure.patch b/pkgs/tools/audio/spotdl/is_lrc_valid-failure.patch new file mode 100644 index 000000000000..e419bca125d2 --- /dev/null +++ b/pkgs/tools/audio/spotdl/is_lrc_valid-failure.patch @@ -0,0 +1,65 @@ +From 0c1357470450d98b3b7fe5444ac460ba9ee04425 Mon Sep 17 00:00:00 2001 +From: Jeremy Cutler +Date: Mon, 17 Jun 2024 02:19:33 -0700 +Subject: [PATCH 1/2] Update lrc.py for updated function in python-syncedlyrics + +See syncedlyrics commit: [here](https://github.com/moehmeni/syncedlyrics/commit/64d3f9de3d17bec69cbc3b3b5acd1ab847fde4b2) +--- + spotdl/utils/lrc.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/spotdl/utils/lrc.py b/spotdl/utils/lrc.py +index 726fefbee..e59490b53 100644 +--- a/spotdl/utils/lrc.py ++++ b/spotdl/utils/lrc.py +@@ -7,7 +7,7 @@ + from pathlib import Path + + from syncedlyrics import search as syncedlyrics_search +-from syncedlyrics.utils import is_lrc_valid, save_lrc_file ++from syncedlyrics.utils import has_translation, save_lrc_file + + from spotdl.types.song import Song + +@@ -25,7 +25,7 @@ def generate_lrc(song: Song, output_file: Path): + - output_file: Path to the output file + """ + +- if song.lyrics and is_lrc_valid(song.lyrics): ++ if song.lyrics and has_translation(song.lyrics): + lrc_data = song.lyrics + else: + try: + +From bfa9456049132e64b5c83655bdeae7c9dcd1b532 Mon Sep 17 00:00:00 2001 +From: Jeremy Cutler +Date: Wed, 26 Jun 2024 18:06:59 -0700 +Subject: [PATCH 2/2] Update lrc.py + +Seems to have fixed the update of syncedlyrics to 1.0.0 +--- + spotdl/utils/lrc.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/spotdl/utils/lrc.py b/spotdl/utils/lrc.py +index e59490b53..cf7478214 100644 +--- a/spotdl/utils/lrc.py ++++ b/spotdl/utils/lrc.py +@@ -7,7 +7,7 @@ + from pathlib import Path + + from syncedlyrics import search as syncedlyrics_search +-from syncedlyrics.utils import has_translation, save_lrc_file ++from syncedlyrics.utils import has_translation, Lyrics + + from spotdl.types.song import Song + +@@ -34,7 +34,7 @@ def generate_lrc(song: Song, output_file: Path): + lrc_data = None + + if lrc_data: +- save_lrc_file(str(output_file.with_suffix(".lrc")), lrc_data) ++ Lyrics.save_lrc_file(str(output_file.with_suffix(".lrc")), lrc_data) + logger.debug("Saved lrc file for %s", song.display_name) + else: + logger.debug("No lrc file found for %s", song.display_name)