From f59e64ab9eeafd872dc555161ffd298d670c99fe Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Tue, 11 Jun 2019 11:54:27 +0200 Subject: [PATCH 1/4] Fix #855: secondary menus truncated on narrow screens --- changes/changelog.d/855.bugfix | 1 + front/src/style/_main.scss | 1 + 2 files changed, 2 insertions(+) create mode 100644 changes/changelog.d/855.bugfix diff --git a/changes/changelog.d/855.bugfix b/changes/changelog.d/855.bugfix new file mode 100644 index 000000000..171865ed7 --- /dev/null +++ b/changes/changelog.d/855.bugfix @@ -0,0 +1 @@ +Fixed secondary menus truncated on narrow screens (#855) diff --git a/front/src/style/_main.scss b/front/src/style/_main.scss index 8f8ee8b16..d1eb1e3fb 100644 --- a/front/src/style/_main.scss +++ b/front/src/style/_main.scss @@ -126,6 +126,7 @@ body { margin-left: 0; margin-right: 0; border: none; + overflow-y: auto; box-shadow: inset 0px -2px 0px 0px rgba(34, 36, 38, 0.15); .ui.item { border: none; From 05f2ca53b876b7fbb69e3ada0dc21f2d0a309644 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Tue, 11 Jun 2019 13:41:56 +0200 Subject: [PATCH 2/4] Fix #814: Added copy-to-clipboard button with Subsonic password input --- changes/changelog.d/814.enhancement | 1 + .../src/components/auth/SubsonicTokenForm.vue | 11 ++++++-- front/src/components/forms/PasswordInput.vue | 28 +++++++++++++++++-- 3 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 changes/changelog.d/814.enhancement diff --git a/changes/changelog.d/814.enhancement b/changes/changelog.d/814.enhancement new file mode 100644 index 000000000..c93b1983c --- /dev/null +++ b/changes/changelog.d/814.enhancement @@ -0,0 +1 @@ +Added copy-to-clipboard button with Subsonic password input (#814) diff --git a/front/src/components/auth/SubsonicTokenForm.vue b/front/src/components/auth/SubsonicTokenForm.vue index 0184074e2..fdd9f5e10 100644 --- a/front/src/components/auth/SubsonicTokenForm.vue +++ b/front/src/components/auth/SubsonicTokenForm.vue @@ -24,7 +24,12 @@ From 3de249b54ce3cb7a6d6192f659f6651b0a04bb20 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Tue, 11 Jun 2019 14:21:59 +0200 Subject: [PATCH 3/4] Fix #833: broken translation on home and track detail page --- changes/changelog.d/833.bugfix | 1 + front/src/components/Home.vue | 11 +++++------ front/src/components/library/TrackBase.vue | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 changes/changelog.d/833.bugfix diff --git a/changes/changelog.d/833.bugfix b/changes/changelog.d/833.bugfix new file mode 100644 index 000000000..06ce086f5 --- /dev/null +++ b/changes/changelog.d/833.bugfix @@ -0,0 +1 @@ +Fixed broken translation on home and track detail page (#833) diff --git a/front/src/components/Home.vue b/front/src/components/Home.vue index b88369d95..9393d9b78 100644 --- a/front/src/components/Home.vue +++ b/front/src/components/Home.vue @@ -68,12 +68,7 @@
-
- Get quality metadata about your music thanks to MusicBrainz -
+
@@ -147,6 +142,10 @@ export default { return { title: this.$pgettext('Head/Home/Title', "Welcome") } + }, + musicbrainzItem () { + let msg = this.$pgettext('Content/Home/List item/Verb', 'Get quality metadata about your music thanks to MusicBrainz') + return this.$gettextInterpolate(msg, {url: this.musicbrainzUrl}) } } } diff --git a/front/src/components/library/TrackBase.vue b/front/src/components/library/TrackBase.vue index 639c8f51b..4d396bd1a 100644 --- a/front/src/components/library/TrackBase.vue +++ b/front/src/components/library/TrackBase.vue @@ -14,11 +14,7 @@
{{ track.title }} -
-
From album %{ album } by %{ artist }
-
+
@@ -218,6 +214,10 @@ export default { ")" ) }, + subtitle () { + let msg = this.$pgettext('Content/Track/Paragraph', 'From album %{ album } by %{ artist }') + return this.$gettextInterpolate(msg, {album: this.track.album.title, artist: this.track.artist.name, albumUrl: this.albumUrl, artistUrl: this.artistUrl}) + } }, watch: { id() { From 0a25243e259d26957fb7099dcf19b0a9b8b02e16 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Thu, 13 Jun 2019 11:05:28 +0200 Subject: [PATCH 4/4] Fix #857: Fix broken upload for specific files when using S3 storage --- api/funkwhale_api/music/utils.py | 2 +- api/tests/music/test_utils.py | 9 +++++++++ changes/changelog.d/857.bugfix | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 changes/changelog.d/857.bugfix diff --git a/api/funkwhale_api/music/utils.py b/api/funkwhale_api/music/utils.py index 5031e69ba..571bc4ddd 100644 --- a/api/funkwhale_api/music/utils.py +++ b/api/funkwhale_api/music/utils.py @@ -12,7 +12,7 @@ def guess_mimetype(f): t = magic.from_buffer(f.read(b), mime=True) if not t.startswith("audio/"): # failure, we try guessing by extension - mt, _ = mimetypes.guess_type(f.path) + mt, _ = mimetypes.guess_type(f.name) if mt: t = mt return t diff --git a/api/tests/music/test_utils.py b/api/tests/music/test_utils.py index 87eaddc43..982422c34 100644 --- a/api/tests/music/test_utils.py +++ b/api/tests/music/test_utils.py @@ -36,3 +36,12 @@ def test_get_audio_file_data(name, expected): result = utils.get_audio_file_data(f) assert result == expected + + +def test_guess_mimetype_dont_crash_with_s3(factories, mocker, settings): + """See #857""" + settings.DEFAULT_FILE_STORAGE = "funkwhale_api.common.storage.ASCIIS3Boto3Storage" + mocker.patch("magic.from_buffer", return_value="none") + f = factories["music.Upload"].build(audio_file__filename="test.mp3") + + assert utils.guess_mimetype(f.audio_file) == "audio/mpeg" diff --git a/changes/changelog.d/857.bugfix b/changes/changelog.d/857.bugfix new file mode 100644 index 000000000..5d525e3d9 --- /dev/null +++ b/changes/changelog.d/857.bugfix @@ -0,0 +1 @@ +Fix broken upload for specific files when using S3 storage (#857)