From 5e7985387ef7ab4e586e553224f336f68abbe9fd Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Tue, 21 Aug 2018 18:22:57 +0200 Subject: [PATCH 1/3] Fix #490: Ensure we always have a default api url set on first load to avoid displaying the instance picker --- .gitlab-ci.yml | 2 +- changes/changelog.d/490.bugfix | 1 + front/src/App.vue | 11 ++++++----- front/src/store/instance.js | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 changes/changelog.d/490.bugfix diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4ddde5b79..57b7dfc7f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,7 +28,7 @@ review_front: - yarn run i18n-compile # this is to ensure we don't have any errors in the output, # cf https://code.eliotberriot.com/funkwhale/funkwhale/issues/169 - - INSTANCE_URL=$REVIEW_INSTANCE_URL yarn run build | tee /dev/stderr | (! grep -i 'ERROR in') + - VUE_APP_INSTANCE_URL=$REVIEW_INSTANCE_URL yarn run build | tee /dev/stderr | (! grep -i 'ERROR in') - mkdir -p /static/front/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG - cp -r dist/* /static/front/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG cache: diff --git a/changes/changelog.d/490.bugfix b/changes/changelog.d/490.bugfix new file mode 100644 index 000000000..da37bdf4b --- /dev/null +++ b/changes/changelog.d/490.bugfix @@ -0,0 +1 @@ +Ensure we always have a default api url set on first load to avoid displaying the instance picker (#490) diff --git a/front/src/App.vue b/front/src/App.vue index f80020e93..c8134a4a0 100644 --- a/front/src/App.vue +++ b/front/src/App.vue @@ -124,12 +124,13 @@ export default { // used to redraw ago dates every minute self.$store.commit('ui/computeLastDate') }, 1000 * 60) - if (this.$store.state.instance.instanceUrl) { - this.$store.commit('instance/instanceUrl', this.$store.state.instance.instanceUrl) - this.$store.dispatch('auth/check') - this.$store.dispatch('instance/fetchSettings') - this.fetchNodeInfo() + if (!this.$store.state.instance.instanceUrl) { + let defaultInstanceUrl = process.env.VUE_APP_INSTANCE_URL || this.$store.getters['instance/defaultUrl']() + this.$store.commit('instance/instanceUrl', defaultInstanceUrl) } + this.$store.dispatch('auth/check') + this.$store.dispatch('instance/fetchSettings') + this.fetchNodeInfo() }, methods: { fetchNodeInfo () { diff --git a/front/src/store/instance.js b/front/src/store/instance.js index 5610b0ec7..163c595e3 100644 --- a/front/src/store/instance.js +++ b/front/src/store/instance.js @@ -14,7 +14,7 @@ export default { state: { maxEvents: 200, frontSettings: {}, - instanceUrl: process.env.INSTANCE_URL, + instanceUrl: process.env.VUE_APP_INSTANCE_URL, events: [], settings: { instance: { From 19ace8dd40babd9e5169b03d1627a5edae8e92fd Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Tue, 21 Aug 2018 18:30:31 +0200 Subject: [PATCH 2/3] Fixed #494: CLI importer syntax error because of async reserved keyword usage --- .../providers/audiofile/management/commands/import_files.py | 4 ++-- changes/changelog.d/494.bugfix | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changes/changelog.d/494.bugfix diff --git a/api/funkwhale_api/providers/audiofile/management/commands/import_files.py b/api/funkwhale_api/providers/audiofile/management/commands/import_files.py index 2aba0c145..625f9c2f0 100644 --- a/api/funkwhale_api/providers/audiofile/management/commands/import_files.py +++ b/api/funkwhale_api/providers/audiofile/management/commands/import_files.py @@ -216,8 +216,8 @@ class Command(BaseCommand): message = "{i}/{total} Launching import for {path}..." # we create an import batch binded to the user - async = options["async"] - import_handler = tasks.import_job_run.delay if async else tasks.import_job_run + async_ = options["async"] + import_handler = tasks.import_job_run.delay if async_ else tasks.import_job_run batch = user.imports.create(source="shell") errors = [] for i, path in list(enumerate(paths)): diff --git a/changes/changelog.d/494.bugfix b/changes/changelog.d/494.bugfix new file mode 100644 index 000000000..4fc77f858 --- /dev/null +++ b/changes/changelog.d/494.bugfix @@ -0,0 +1 @@ +Fixed CLI importer syntax error because of async reserved keyword usage (#494) From 658de6fe84b0cac151633b30191630112e899af6 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Tue, 21 Aug 2018 19:03:00 +0200 Subject: [PATCH 3/3] Version bump and changelog for 0.16.2 --- CHANGELOG | 14 ++++++++++++++ api/funkwhale_api/__init__.py | 2 +- changes/changelog.d/490.bugfix | 1 - changes/changelog.d/494.bugfix | 1 - 4 files changed, 15 insertions(+), 3 deletions(-) delete mode 100644 changes/changelog.d/490.bugfix delete mode 100644 changes/changelog.d/494.bugfix diff --git a/CHANGELOG b/CHANGELOG index 9ef9fd667..7fcaceaf4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,6 +10,20 @@ This changelog is viewable on the web at https://docs.funkwhale.audio/changelog. .. towncrier +0.16.2 (2018-08-21) +------------------- + +Upgrade instructions are available at +https://docs.funkwhale.audio/upgrading.html + +Bugfixes: + +- Ensure we always have a default api url set on first load to avoid displaying + the instance picker (#490) +- Fixed CLI importer syntax error because of async reserved keyword usage + (#494) + + 0.16.1 (2018-08-19) ------------------- diff --git a/api/funkwhale_api/__init__.py b/api/funkwhale_api/__init__.py index 4b0303cdc..b897028f2 100644 --- a/api/funkwhale_api/__init__.py +++ b/api/funkwhale_api/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -__version__ = "0.16.1" +__version__ = "0.16.2" __version_info__ = tuple( [ int(num) if num.isdigit() else num diff --git a/changes/changelog.d/490.bugfix b/changes/changelog.d/490.bugfix deleted file mode 100644 index da37bdf4b..000000000 --- a/changes/changelog.d/490.bugfix +++ /dev/null @@ -1 +0,0 @@ -Ensure we always have a default api url set on first load to avoid displaying the instance picker (#490) diff --git a/changes/changelog.d/494.bugfix b/changes/changelog.d/494.bugfix deleted file mode 100644 index 4fc77f858..000000000 --- a/changes/changelog.d/494.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixed CLI importer syntax error because of async reserved keyword usage (#494)