diff --git a/beetsplug/plexupdate.py b/beetsplug/plexupdate.py index 3bfcba4c0..c61766c43 100644 --- a/beetsplug/plexupdate.py +++ b/beetsplug/plexupdate.py @@ -21,7 +21,7 @@ def get_music_section(host, port): """Getting the section key for the music library in Plex. """ api_endpoint = 'library/sections' - url = urljoin('http://{}:{}'.format(host, port), api_endpoint) + url = urljoin('http://{0}:{1}'.format(host, port), api_endpoint) # Sends request. r = requests.get(url) @@ -38,8 +38,8 @@ def update_plex(host, port): """ # Getting section key and build url. section_key = get_music_section(host, port) - api_endpoint = 'library/sections/{}/refresh'.format(section_key) - url = urljoin('http://{}:{}'.format(host, port), api_endpoint) + api_endpoint = 'library/sections/{0}/refresh'.format(section_key) + url = urljoin('http://{0}:{1}'.format(host, port), api_endpoint) # Sends request and returns requests object. r = requests.get(url) diff --git a/docs/plugins/plexupdate.rst b/docs/plugins/plexupdate.rst index b051f24b5..09ff940de 100644 --- a/docs/plugins/plexupdate.rst +++ b/docs/plugins/plexupdate.rst @@ -4,8 +4,6 @@ PlexUpdate Plugin ``plexupdate`` is a very simple plugin for beets that lets you automatically update `Plex`_'s music library whenever you change your beets library. -.. _Plex: http://plex.tv/ - To use ``plexupdate`` plugin, enable it in your configuration (see :ref:`using-plugins`). Then, you'll probably want to configure the specifics of your Plex server. @@ -14,11 +12,18 @@ which looks like this:: plex: host: localhost - port: 32400 + port: 32400 + +To use the ``plexupdate`` plugin you need to install the `requests`_ library with: + + pip install requests With that all in place, you'll see beets send the "update" command to your Plex server every time you change your beets library. +.. _Plex: http://plex.tv/ +.. _requests: http://docs.python-requests.org/en/latest/ + Configuration -------------