Accepting request 1199820 from multimedia:apps

OBS-URL: https://build.opensuse.org/request/show/1199820
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/picard?expand=0&rev=73
This commit is contained in:
Ana Guerrero 2024-09-10 19:14:01 +00:00 committed by Git OBS Bridge
commit 997f99762d
5 changed files with 35 additions and 50 deletions

View File

@ -1,44 +0,0 @@
From b1a8b2c85c0615c2018de3c054d59f2a0b5315bd Mon Sep 17 00:00:00 2001
From: Philipp Wolfer <ph.wolfer@gmail.com>
Date: Sat, 13 Jul 2024 11:05:31 +0200
Subject: [PATCH] PICARD-2939: Fix exception when genre filtering results in
empty genre list
---
picard/track.py | 2 ++
test/test_taggenrefilter.py | 12 ++++++++++++
2 files changed, 14 insertions(+)
diff --git a/picard/track.py b/picard/track.py
index 3da608de7f..025ebb8b55 100644
--- a/picard/track.py
+++ b/picard/track.py
@@ -115,6 +115,8 @@ def filter(self, counter: Counter, minusage=0) -> Counter:
for name, count in counter.items():
if not self.skip(name):
result[name] = count
+ if not result:
+ return result
topcount = result.most_common(1)[0][1]
for name, count in counter.items():
percent = 100 * count // topcount
diff --git a/test/test_taggenrefilter.py b/test/test_taggenrefilter.py
index 01a54c383d..46cb5a5a52 100644
--- a/test/test_taggenrefilter.py
+++ b/test/test_taggenrefilter.py
@@ -178,3 +178,15 @@ def test_filter_method_minusage(self):
genres = Counter(ax=4, bx=5, ay=20, by=10, bz=4)
result = tag_filter.filter(genres, minusage=50)
self.assertEqual([('bx', 5), ('by', 10)], list(result.items()))
+
+ def test_filter_method_empty_input(self):
+ tag_filter = TagGenreFilter("")
+ genres = Counter()
+ result = tag_filter.filter(genres)
+ self.assertEqual([], list(result.items()))
+
+ def test_filter_method_empty_result(self):
+ tag_filter = TagGenreFilter("-*")
+ genres = Counter(ax=1, bx=2, ay=3, by=4)
+ result = tag_filter.filter(genres)
+ self.assertEqual([], list(result.items()))

3
picard-2.12.3.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1c39ab22cff39a7eede94510f6d035ea2d4600811b62f8f4a58399ede3d8e6a4
size 6841838

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9e292f6ab693525fd799641cad3859b89c2404a93819042aa564f285113a82d1
size 6822579

View File

@ -1,3 +1,34 @@
-------------------------------------------------------------------
Mon Sep 9 06:46:48 UTC 2024 - Michael Vetter <mvetter@suse.com>
- Update 2.12.3:
* PICARD-2958 - Hovering over unmatched files shows a tooltip with
the PO translation file header for the active locale
* PICARD-2960 - Replacement for directory separators can itself be
set to a directory separator
-------------------------------------------------------------------
Mon Sep 9 06:46:36 UTC 2024 - Michael Vetter <mvetter@suse.com>
- Update to 2.12.2:
* PICARD-2953 - Windows: Incorrect sort order in list views and
search result
-------------------------------------------------------------------
Mon Sep 9 06:46:28 UTC 2024 - Michael Vetter <mvetter@suse.com>
- Update to 2.12.1:
* PICARD-2914 - macOS: Crash when opening options with Spanish UI
* PICARD-2939 - Crash when loading release with genre filters resulting
in empty genre list
* PICARD-2940 - Possible bug with locking in Metadata.__iter__
* PICARD-2946 - Fix display length value in AppStream metadata
-------------------------------------------------------------------
Mon Sep 2 14:10:38 UTC 2024 - Michael Vetter <mvetter@suse.com>
- Drop 0001-Fix-exception-when-genre-filtering-results-in.patch
-------------------------------------------------------------------
Mon Aug 12 15:25:02 UTC 2024 - Antonio Larrosa <alarrosa@suse.com>

View File

@ -17,7 +17,7 @@
Name: picard
Version: 2.12
Version: 2.12.3
Release: 0
Summary: The Next Generation MusicBrainz Tagger
License: GPL-2.0-or-later
@ -26,8 +26,6 @@ URL: https://picard.musicbrainz.org
Source0: https://codeload.github.com/metabrainz/picard/tar.gz/release-%{version}#/%{name}-%{version}.tar.gz
# PATCH-FIX-SUSE picard-requirements.patch, code@bnavigator.de -- clean python requirements metadata
Patch0: picard-requirements.patch
# PATCH-FIX-UPSTREAM 0001-Fix-exception-when-genre-filtering-results-in.patch alarrosa@suse.com -- Fix segfault when genre filtering results in empty list
Patch1: 0001-Fix-exception-when-genre-filtering-results-in.patch
BuildRequires: desktop-file-utils
BuildRequires: fdupes
BuildRequires: gcc-c++