Wednesday, August 10, 2022

Re: audio/quodlibet & devel/libsoup

On Sun, Aug 07, 2022 at 03:26:16PM +0100, Laurence Tratt wrote:

> With the 4.5.0 update in ports, I get a Python exception on most actions,
> which seems to relate to cover art:
>
> AttributeError: 'gi.repository.Soup' object has no attribute 'URI'
> ------
> Traceback (most recent call last):
> File "/usr/local/lib/python3.9/site-packages/quodlibet/util/cover/manager.py", line 120, in failure
> run()
> File "/usr/local/lib/python3.9/site-packages/quodlibet/util/cover/manager.py", line 136, in run
> provider.fetch_cover()
> File "/usr/local/lib/python3.9/site-packages/quodlibet/util/cover/http.py", line 86, in fetch_cover
> if not self.url:
> File "/usr/local/lib/python3.9/site-packages/quodlibet/ext/covers/discogs.py", line 63, in url
> artist = escape_query_value(artists)
> File "/usr/local/lib/python3.9/site-packages/quodlibet/util/cover/http.py", line 111, in escape_query_value
> return Soup.URI.encode(s, '&')
> File "/usr/local/lib/python3.9/site-packages/gi/module.py", line 123, in __getattr__
> raise AttributeError("%r object has no attribute %r" % (
> AttributeError: 'gi.repository.Soup' object has no attribute 'URI'
>
> Music and so on seem to play correctly, though, which is the main thing!

The fix for this was easier than I expected: for some reason we aren't
importing Soup.URI (is that a bug in upstream or one of our dependencies?
I'm unsure). The patch below gives me a version of quodlibet which doesn't
throw constant errors and which seems capable of fetching cover art and so
on.


Laurie


Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/quodlibet/Makefile,v
retrieving revision 1.40
diff -u -p -u -r1.40 Makefile
--- Makefile 6 Aug 2022 11:08:47 -0000 1.40
+++ Makefile 10 Aug 2022 14:43:00 -0000
@@ -1,6 +1,7 @@
COMMENT= audio player and tagger for GTK+ with regex support

MODPY_EGG_VERSION= 4.5.0
+REVISION= 0
DISTNAME= quodlibet-${MODPY_EGG_VERSION}
PORTROACH= skipv:release-${MODPY_EGG_VERSION}

Index: patches/patch-quodlibet_util_cover_http_py
===================================================================
RCS file: patches/patch-quodlibet_util_cover_http_py
diff -N patches/patch-quodlibet_util_cover_http_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-quodlibet_util_cover_http_py 10 Aug 2022 14:43:00 -0000
@@ -0,0 +1,11 @@
+Index: quodlibet/util/cover/http.py
+--- quodlibet/util/cover/http.py.orig
++++ quodlibet/util/cover/http.py
+@@ -106,6 +106,6 @@ class ApiCoverSourcePlugin(CoverSourcePlugin, HTTPDown
+ people = list(filter(None, people))
+ return people[0] if people else None
+
+-
++import Soup.URI
+ def escape_query_value(s):
+ return Soup.URI.encode(s, '&')

No comments:

Post a Comment