docs: Move Spotify to ext registry

This commit is contained in:
Stein Magnus Jodal 2013-04-12 00:05:56 +02:00
parent 12938df3a1
commit 08117841c1
5 changed files with 81 additions and 79 deletions

68
docs/ext/spotify.rst Normal file
View File

@ -0,0 +1,68 @@
.. _ext-spotify:
**************
Mopidy-Spotify
**************
An extension for playing music from Spotify.
`Spotify <http://www.spotify.com/>`_ is a music streaming service. The backend
uses the official `libspotify
<http://developer.spotify.com/en/libspotify/overview/>`_ library and the
`pyspotify <http://github.com/mopidy/pyspotify/>`_ Python bindings for
libspotify. This backend handles URIs starting with ``spotify:``.
See :ref:`music-from-spotify` for further instructions on using this backend.
.. note::
This product uses SPOTIFY(R) CORE but is not endorsed, certified or
otherwise approved in any way by Spotify. Spotify is the registered
trade mark of the Spotify Group.
Known issues
============
https://github.com/mopidy/mopidy/issues?labels=Spotify+backend
Dependencies
============
.. literalinclude:: ../../requirements/spotify.txt
Configuration values
====================
.. confval:: spotify/enabled
If the Spotify extension should be enabled or not.
.. confval:: spotify/username
Your Spotify Premium username.
.. confval:: spotify/password
Your Spotify Premium password.
.. confval:: spotify/bitrate
The preferred audio bitrate. Valid values are 96, 160, 320.
.. confval:: spotify/timeout
Max number of seconds to wait for Spotify operations to complete.
.. confval:: spotify/cache_dir
Path to the Spotify data cache. Cannot be shared with other Spotify apps.
Default configuration
=====================
.. literalinclude:: ../../mopidy/backends/spotify/ext.conf
:language: ini

View File

@ -4,7 +4,7 @@ Mopidy
Mopidy is a music server which can play music both from multiple sources, like
your :ref:`local hard drive <local-backend>`, :ref:`radio streams
<stream-backend>`, and from :ref:`Spotify <spotify-backend>` and SoundCloud.
<stream-backend>`, and from :ref:`Spotify <ext-spotify>` and SoundCloud.
Searches combines results from all music sources, and you can mix tracks from
all sources in your play queue. Your playlists from Spotify or SoundCloud are
also available for use.

View File

@ -1,8 +0,0 @@
.. _spotify-backend:
*************************************************
:mod:`mopidy.backends.spotify` -- Spotify backend
*************************************************
.. automodule:: mopidy.backends.spotify
:synopsis: Backend for the Spotify music streaming service

View File

@ -1,77 +1,11 @@
from __future__ import unicode_literals
import os
import mopidy
from mopidy import ext
from mopidy.exceptions import ExtensionError
from mopidy.utils import config, formatting
default_config = """
[spotify]
enabled = true
username =
password =
bitrate = 160
timeout = 10
cache_dir = $XDG_CACHE_DIR/mopidy/spotify
"""
__doc__ = """A backend for playing music from Spotify
`Spotify <http://www.spotify.com/>`_ is a music streaming service. The backend
uses the official `libspotify
<http://developer.spotify.com/en/libspotify/overview/>`_ library and the
`pyspotify <http://github.com/mopidy/pyspotify/>`_ Python bindings for
libspotify. This backend handles URIs starting with ``spotify:``.
See :ref:`music-from-spotify` for further instructions on using this backend.
.. note::
This product uses SPOTIFY(R) CORE but is not endorsed, certified or
otherwise approved in any way by Spotify. Spotify is the registered
trade mark of the Spotify Group.
**Issues**
https://github.com/mopidy/mopidy/issues?labels=Spotify+backend
**Dependencies**
.. literalinclude:: ../../../requirements/spotify.txt
**Configuration**
.. confval:: spotify/enabled
If the Spotify extension should be enabled or not.
.. confval:: spotify/username
Your Spotify Premium username.
.. confval:: spotify/password
Your Spotify Premium password.
.. confval:: spotify/bitrate
The preferred audio bitrate. Valid values are 96, 160, 320.
.. confval:: spotify/timeout
Max number of seconds to wait for Spotify operations to complete.
.. confval:: spotify/cache_dir
Path to the Spotify data cache. Cannot be shared with other Spotify apps.
**Default config**
.. code-block:: ini
%(config)s
""" % {'config': formatting.indent(default_config)}
from mopidy.utils import config
class Extension(ext.Extension):
@ -81,7 +15,8 @@ class Extension(ext.Extension):
version = mopidy.__version__
def get_default_config(self):
return default_config
conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf')
return open(conf_file).read()
def get_config_schema(self):
schema = config.ExtensionConfigSchema()

View File

@ -0,0 +1,7 @@
[spotify]
enabled = true
username =
password =
bitrate = 160
timeout = 10
cache_dir = $XDG_CACHE_DIR/mopidy/spotify