From 9794826f267ea4084208a66d87ed2117451e5c17 Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Wed, 4 Dec 2013 22:52:24 +0100 Subject: [PATCH] local: Review changes --- docs/ext/local.rst | 10 +++++----- docs/extensiondev.rst | 13 +------------ mopidy/backends/local/translator.py | 4 ++-- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/docs/ext/local.rst b/docs/ext/local.rst index 51268c51..9e7c645c 100644 --- a/docs/ext/local.rst +++ b/docs/ext/local.rst @@ -85,11 +85,11 @@ To make a local library for your music available for Mopidy: #. Start Mopidy, find the music library in a client, and play some local music! -Plugable library support ------------------------- +Pluggable library support +------------------------- Local libraries are fully pluggable. What this means is that users may opt to -disable the current default library `local-json`, replacing it with a third +disable the current default library ``local-json``, replacing it with a third party one. When running :command:`mopidy local scan` mopidy will populate whatever the current active library is with data. Only one library may be active at a time. @@ -115,8 +115,8 @@ Configuration values .. confval:: local-json/enabled - If the local extension should be enabled or not. + If the local-json extension should be enabled or not. .. confval:: local-json/json_file - Path to a file to store the gziped json data in. + Path to a file to store the GZiped JSON data in. diff --git a/docs/extensiondev.rst b/docs/extensiondev.rst index 2709690a..82144d0a 100644 --- a/docs/extensiondev.rst +++ b/docs/extensiondev.rst @@ -428,18 +428,7 @@ solution you happen to prefer. super(SoundspotLibraryUpdateProvider, self).__init__(config) self.config = config - def load(self): - # Your track loading code - return tracks - - def add(self, track): - # Your code for handling adding a new track - - def remove(self, uri): - # Your code for removing the track coresponding to this uri - - def commit(self): - # Your code to persist the library, if needed. + # Your library provider implementation here. Example GStreamer element diff --git a/mopidy/backends/local/translator.py b/mopidy/backends/local/translator.py index 2c0523e8..243eb314 100644 --- a/mopidy/backends/local/translator.py +++ b/mopidy/backends/local/translator.py @@ -17,13 +17,13 @@ def local_track_uri_to_file_uri(uri, media_dir): def local_track_uri_to_path(uri, media_dir): if not uri.startswith('local:track:'): - raise ValueError('Invalid uri.') + raise ValueError('Invalid URI.') file_path = uri_to_path(uri).split(b':', 1)[1] return os.path.join(media_dir, file_path) def path_to_local_track_uri(relpath): - """Convert path releative to media_dir to local track uri""" + """Convert path releative to media_dir to local track URI.""" if isinstance(relpath, unicode): relpath = relpath.encode('utf-8') return b'local:track:%s' % urllib.quote(relpath)