forked from mopidy/mopidy-spotify
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlibrary.py
39 lines (26 loc) · 1.11 KB
/
library.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from __future__ import unicode_literals
import logging
from mopidy import backend
from mopidy_spotify import browse, distinct, images, lookup, search
logger = logging.getLogger(__name__)
class SpotifyLibraryProvider(backend.LibraryProvider):
root_directory = browse.ROOT_DIR
def __init__(self, backend):
self._backend = backend
self._config = backend._config['spotify']
def browse(self, uri):
return browse.browse(self._config, self._backend._session, uri)
def get_distinct(self, field, query=None):
return distinct.get_distinct(
self._config, self._backend._session, self._backend._web_client,
field, query)
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._session, self._backend._web_client,
uri)
def search(self, query=None, uris=None, exact=False):
return search.search(
self._config, self._backend._session, self._backend._web_client,
query, uris, exact)