From fa1624659a0b113d487c1365cce0c5a75fe4851d Mon Sep 17 00:00:00 2001 From: Nick Steel Date: Mon, 29 Apr 2024 13:57:28 +0100 Subject: [PATCH] Temporary hack for Mopidy v4 installations --- src/mopidy_spotify/library.py | 3 +++ tests/test_lookup.py | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/mopidy_spotify/library.py b/src/mopidy_spotify/library.py index 51d1c878..ff38e1e8 100644 --- a/src/mopidy_spotify/library.py +++ b/src/mopidy_spotify/library.py @@ -34,6 +34,9 @@ def get_distinct(self, field, query=None): def get_images(self, uris): return images.get_images(self._backend._web_client, uris) + def lookup(self, uri): + return lookup.lookup(self._config, self._backend._web_client, [uri]) + def lookup_many(self, uris): return lookup.lookup(self._config, self._backend._web_client, uris) diff --git a/tests/test_lookup.py b/tests/test_lookup.py index 4116152d..0bd28346 100644 --- a/tests/test_lookup.py +++ b/tests/test_lookup.py @@ -2,6 +2,7 @@ from unittest import mock import pytest +import mopidy from mopidy_spotify import lookup @@ -322,3 +323,9 @@ def test_lookup_no_cache_artist(web_client_mock, web_album_mock, provider): assert len(results3) == 2 assert results3["spotify:album:def"][0].uri == "spotify:track:abc" assert results3["spotify:track:abc"][0].uri == "spotify:track:abc" + + +def test_lookup_v4_compatible(provider): + # TODO: Remove this once we release the major version + provider.lookup("foo") + assert mopidy.__version__.startswith("4.0.0a")