[plugin, scrobbler] Use last.fm API v2 for scrobbling if API key and secret are provided

This commit is contained in:
Agate 2020-08-26 12:26:27 +02:00
parent 00b6fb512f
commit cce158b60b
9 changed files with 160 additions and 34 deletions

View file

@ -1,19 +1,13 @@
"""
A plugin that enables scrobbling to ListenBrainz and Last.fm.
If you're scrobbling to last.fm, you will need to create an `API account <https://www.last.fm/api/account/create>`_
and add two variables two your .env file:
- ``FUNKWHALE_PLUGIN_SCROBBLER_LASTFM_API_KEY=apikey``
- ``FUNKWHALE_PLUGIN_SCROBBLER_LASTFM_API_SECRET=apisecret``
"""
from config import plugins
PLUGIN = plugins.get_plugin_config(
name="scrobbler",
label="Scrobbler",
description="A plugin that enables scrobbling to ListenBrainz and Last.fm",
description=(
"A plugin that enables scrobbling to ListenBrainz and Last.fm. "
"It must be configured on the server if you use Last.fm."
),
homepage="https://dev.funkwhale.audio/funkwhale/funkwhale/-/blob/develop/api/funkwhale_api/contrib/scrobbler/README.rst", # noqa
version="0.1",
user=True,
conf=[
@ -34,8 +28,8 @@ PLUGIN = plugins.get_plugin_config(
{"name": "username", "type": "text", "label": "Your scrobbler username"},
{"name": "password", "type": "password", "label": "Your scrobbler password"},
],
# settings=[
# {"name": "lastfm_api_key", "type": "text"},
# {"name": "lastfm_api_secret", "type": "text"},
# ]
settings=[
{"name": "lastfm_api_key", "type": "text"},
{"name": "lastfm_api_secret", "type": "text"},
],
)