From 60347ccd8cbcc083b44aed4359dea2c53bc4f68e Mon Sep 17 00:00:00 2001 From: Georg Krause Date: Fri, 19 Nov 2021 11:55:10 +0100 Subject: [PATCH 1/3] Allow oauth token expiration time to be configured --- api/config/settings/common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/config/settings/common.py b/api/config/settings/common.py index b86b5521..d9b2df10 100644 --- a/api/config/settings/common.py +++ b/api/config/settings/common.py @@ -621,7 +621,9 @@ OAUTH2_PROVIDER = { # we keep expired tokens for 15 days, for tracability "REFRESH_TOKEN_EXPIRE_SECONDS": 3600 * 24 * 15, "AUTHORIZATION_CODE_EXPIRE_SECONDS": 5 * 60, - "ACCESS_TOKEN_EXPIRE_SECONDS": 60 * 60 * 10, + "ACCESS_TOKEN_EXPIRE_SECONDS": env.int( + "ACCESS_TOKEN_EXPIRE_SECONDS", default=60 * 60 * 10 + ), "OAUTH2_SERVER_CLASS": "funkwhale_api.users.oauth.server.OAuth2Server", } OAUTH2_PROVIDER_APPLICATION_MODEL = "users.Application" From da12e745bf531a29f0ecd4caa6faea1e6860b266 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Wed, 24 Nov 2021 10:59:05 +0100 Subject: [PATCH 2/3] ListenBrainz: Submit media player and submission client information Following new LB submission API specifications. Resolves #1610 --- api/funkwhale_api/contrib/listenbrainz/funkwhale_ready.py | 6 +++++- api/funkwhale_api/contrib/listenbrainz/funkwhale_startup.py | 2 +- changes/changelog.d/1610.enhancement | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changes/changelog.d/1610.enhancement diff --git a/api/funkwhale_api/contrib/listenbrainz/funkwhale_ready.py b/api/funkwhale_api/contrib/listenbrainz/funkwhale_ready.py index fbaaf94b..4046f28c 100644 --- a/api/funkwhale_api/contrib/listenbrainz/funkwhale_ready.py +++ b/api/funkwhale_api/contrib/listenbrainz/funkwhale_ready.py @@ -1,4 +1,5 @@ from config import plugins +import funkwhale_api from .funkwhale_startup import PLUGIN from .client import ListenBrainzClient, Track @@ -21,7 +22,10 @@ def get_track(track): title = track.title album = None additional_info = { - "listening_from": "Funkwhale", + "media_player": "Funkwhale", + "media_player_version": funkwhale_api.__version__, + "submission_client": "Funkwhale ListenBrainz plugin", + "submission_client_version": PLUGIN["version"], "tracknumber": track.position, "discnumber": track.disc_number, } diff --git a/api/funkwhale_api/contrib/listenbrainz/funkwhale_startup.py b/api/funkwhale_api/contrib/listenbrainz/funkwhale_startup.py index 0175f45d..f8229cdc 100644 --- a/api/funkwhale_api/contrib/listenbrainz/funkwhale_startup.py +++ b/api/funkwhale_api/contrib/listenbrainz/funkwhale_startup.py @@ -6,7 +6,7 @@ PLUGIN = plugins.get_plugin_config( label="ListenBrainz", description="A plugin that allows you to submit your listens to ListenBrainz.", homepage="https://docs.funkwhale.audio/users/builtinplugins.html#listenbrainz-plugin", # noqa - version="0.1", + version="0.2", user=True, conf=[ { diff --git a/changes/changelog.d/1610.enhancement b/changes/changelog.d/1610.enhancement new file mode 100644 index 00000000..e1da7045 --- /dev/null +++ b/changes/changelog.d/1610.enhancement @@ -0,0 +1 @@ +ListenBrainz: Submit media player and submission client information From 87ff5b4da0d3edccd21c06114edcf772817a00a9 Mon Sep 17 00:00:00 2001 From: Georg Krause Date: Sun, 14 Nov 2021 14:49:26 +0100 Subject: [PATCH 3/3] Remove manual checking of dependencies in favor of upcoming renovate bot --- .gitlab-ci.yml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bc9bc5ea..a3a493e3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -361,29 +361,3 @@ build_api: - master@funkwhale/funkwhale - stable@funkwhale/funkwhale - develop@funkwhale/funkwhale - -check_api_dependencies: - interruptible: true - stage: deps - image: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME - cache: - key: "$CI_PROJECT_ID__pip_cache" - paths: - - "$PIP_CACHE_DIR" - variables: - DJANGO_SETTINGS_MODULE: config.settings.local - POSTGRES_HOST_AUTH_METHOD: trust - only: - - branches - before_script: - - apk add make git gcc python3-dev musl-dev - - apk add postgresql-dev py3-psycopg2 libldap libffi-dev make zlib-dev jpeg-dev openldap-dev - - cd api - - pip3 install -r requirements/base.txt - - pip3 install -r requirements/local.txt - - pip3 install -r requirements/test.txt - script: - - $CI_PROJECT_DIR/scripts/check-api-deps.sh - tags: - - docker - allow_failure: true