From 78d63dbaaf5cca0423be1357f9a9d187614ecddf Mon Sep 17 00:00:00 2001 From: codl Date: Thu, 21 May 2020 14:26:19 +0200 Subject: [PATCH 001/138] docker-compose: fix music dir being mounted in the wrong place for nginx --- deploy/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index b895f4ff6..175833300 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -88,7 +88,7 @@ services: volumes: - "./nginx/funkwhale.template:/etc/nginx/conf.d/funkwhale.template:ro" - "./nginx/funkwhale_proxy.conf:/etc/nginx/funkwhale_proxy.conf:ro" - - "${MUSIC_DIRECTORY_SERVE_PATH-/srv/funkwhale/data/music}:${MUSIC_DIRECTORY_SERVE_PATH-/srv/funkwhale/data/music}:ro" + - "${MUSIC_DIRECTORY_SERVE_PATH-/srv/funkwhale/data/music}:${MUSIC_DIRECTORY_PATH-/music}:ro" - "${MEDIA_ROOT}:${MEDIA_ROOT}:ro" - "${STATIC_ROOT}:${STATIC_ROOT}:ro" - "${FUNKWHALE_FRONTEND_PATH}:/frontend:ro" From 925768f1b367bc5eddaeb5341b3a29c63dee4626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Thu, 1 Oct 2020 11:22:36 +0100 Subject: [PATCH 002/138] Resolve 1228 multi-disc albums --- changes/changelog.d/1228.bugfix | 1 + front/src/components/library/AlbumBase.vue | 20 +++++++++++--------- front/src/components/library/AlbumDetail.vue | 4 ++-- 3 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 changes/changelog.d/1228.bugfix diff --git a/changes/changelog.d/1228.bugfix b/changes/changelog.d/1228.bugfix new file mode 100644 index 000000000..226c85057 --- /dev/null +++ b/changes/changelog.d/1228.bugfix @@ -0,0 +1 @@ +Fixed duplication of discs for multi-disc albums in album views (#1228) \ No newline at end of file diff --git a/front/src/components/library/AlbumBase.vue b/front/src/components/library/AlbumBase.vue index 8bdb2fc34..8ae555f6c 100644 --- a/front/src/components/library/AlbumBase.vue +++ b/front/src/components/library/AlbumBase.vue @@ -134,15 +134,17 @@ import TagsList from "@/components/tags/List" import ArtistLabel from '@/components/audio/ArtistLabel' import AlbumDropdown from './AlbumDropdown' -function groupByDisc(acc, track) { - var dn = track.disc_number - 1 - if (dn < 0) dn = 0 - if (acc[dn] == undefined) { - acc.push([track]) - } else { - acc[dn].push(track) +function groupByDisc(initial) { + function inner(acc, track) { + var dn = track.disc_number - initial + if (acc[dn] == undefined) { + acc.push([track]) + } else { + acc[dn].push(track) + } + return acc } - return acc + return inner } export default { @@ -180,7 +182,7 @@ export default { tracksResponse = await tracksResponse this.object = albumResponse.data this.object.tracks = tracksResponse.data.results - this.discs = this.object.tracks.reduce(groupByDisc, []) + this.discs = this.object.tracks.reduce(groupByDisc(this.object.tracks[0].disc_number), []) this.isLoading = false }, remove () { diff --git a/front/src/components/library/AlbumDetail.vue b/front/src/components/library/AlbumDetail.vue index bc670ce6b..b9d4821e6 100644 --- a/front/src/components/library/AlbumDetail.vue +++ b/front/src/components/library/AlbumDetail.vue @@ -7,12 +7,12 @@ From 8d9e7ca52d576051cb1e008a50cf962632049271 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Thu, 19 Nov 2020 17:06:10 +0100 Subject: [PATCH 009/138] Use logarithmic scale for volume slider. Fixes #1222 --- changes/changelog.d/1222.enhancement | 1 + front/src/audio/volume.js | 32 ++++++++++++++++++ front/src/components/audio/VolumeControl.vue | 7 ++-- front/tests/unit/specs/audio/volume.spec.js | 34 ++++++++++++++++++++ 4 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 changes/changelog.d/1222.enhancement create mode 100644 front/src/audio/volume.js create mode 100644 front/tests/unit/specs/audio/volume.spec.js diff --git a/changes/changelog.d/1222.enhancement b/changes/changelog.d/1222.enhancement new file mode 100644 index 000000000..c896000e8 --- /dev/null +++ b/changes/changelog.d/1222.enhancement @@ -0,0 +1 @@ +Logarithmic scale for volume slider (#1222) \ No newline at end of file diff --git a/front/src/audio/volume.js b/front/src/audio/volume.js new file mode 100644 index 000000000..25f6c0ed2 --- /dev/null +++ b/front/src/audio/volume.js @@ -0,0 +1,32 @@ + +// Provides functions to convert between linear and logarithmic volume scales. +// The logarithmic volume from the UI is converted to a linear volume with a +// logarithmic function like exp(b*x)/a. +// Compare https://www.dr-lex.be/info-stuff/volumecontrols.html for how the +// values for a and b got derived. + +const PARAM_A = 1000 +const PARAM_B = Math.log(1000) // ~ 6.908 + +function toLinearVolumeScale(v) { + // Or as approximation: + // return Math.pow(v, 4) + if (v == 0.0) { + return 0.0 + } + + return Math.min(Math.exp(PARAM_B * v) / PARAM_A, 1.0) +} + +function toLogarithmicVolumeScale(v) { + // Or as approximation: + // return Math.exp(Math.log(v) / 4) + if (v == 0.0) { + return 0.0 + } + + return Math.log(v * PARAM_A) / PARAM_B +} + +exports.toLinearVolumeScale = toLinearVolumeScale +exports.toLogarithmicVolumeScale = toLogarithmicVolumeScale diff --git a/front/src/components/audio/VolumeControl.vue b/front/src/components/audio/VolumeControl.vue index 4635d9763..47a2a9594 100644 --- a/front/src/components/audio/VolumeControl.vue +++ b/front/src/components/audio/VolumeControl.vue @@ -29,7 +29,7 @@ @@ -38,6 +38,7 @@ diff --git a/front/src/router/index.js b/front/src/router/index.js index 5f7a0d3d0..d3ce3f4d4 100644 --- a/front/src/router/index.js +++ b/front/src/router/index.js @@ -637,6 +637,23 @@ export default new Router({ defaultPage: route.query.page }) }, + { + path: "podcasts/", + name: "library.podcasts.browse", + component: () => + import( + /* webpackChunkName: "podcasts" */ "@/components/library/Podcasts" + ), + props: route => ({ + defaultOrdering: route.query.ordering, + defaultQuery: route.query.query, + defaultTags: Array.isArray(route.query.tag || []) + ? route.query.tag + : [route.query.tag], + defaultPaginateBy: route.query.paginateBy, + defaultPage: route.query.page + }) + }, { path: "me/albums", name: "library.albums.me", diff --git a/front/src/store/ui.js b/front/src/store/ui.js index f7717685d..2646df3ee 100644 --- a/front/src/store/ui.js +++ b/front/src/store/ui.js @@ -45,6 +45,11 @@ export default { orderingDirection: "-", ordering: "creation_date", }, + "library.podcasts.browse": { + paginateBy: 30, + orderingDirection: "-", + ordering: "creation_date", + }, "library.radios.browse": { paginateBy: 12, orderingDirection: "-", diff --git a/front/src/style/components/_sidebar.scss b/front/src/style/components/_sidebar.scss index c5037d0d1..99867533e 100644 --- a/front/src/style/components/_sidebar.scss +++ b/front/src/style/components/_sidebar.scss @@ -1,244 +1,237 @@ - .ui.wide.left.sidebar { - @include media(">desktop") { - width: $desktop-sidebar-width; - } - - @include media(">widedesktop") { - width: $widedesktop-sidebar-width; - } + @include media(">desktop") { + width: $desktop-sidebar-width; + } + @include media(">widedesktop") { + width: $widedesktop-sidebar-width; + } } - .sidebar { - .logo { - &.bordered.icon { - padding: .5em .41em !important; + .logo { + &.bordered.icon { + padding: .5em .41em !important; + } + path { + fill: white; + } } - path { - fill: white; + .tab { + flex-direction: column; } - } - .tab { - flex-direction: column; - } } .component-sidebar { - .ui.search .input { - flex: 1; - .prompt { - border-radius: 0; + .ui.search .input { + flex: 1; + .prompt { + border-radius: 0; + } } - } - .ui.search .results { - vertical-align: middle; - } - .ui.search .name { - vertical-align: middle; - } - - &.sidebar { - overflow-y: visible !important; - background: var(--sidebar-background); - z-index: 1; - @include media(">desktop") { - display: flex; - flex-direction: column; - justify-content: space-between; - padding-bottom: 4em; + .ui.search .results { + vertical-align: middle; } - > nav { - flex-grow: 1; - overflow-y: auto; + .ui.search .name { + vertical-align: middle; } - @include media(">desktop") { - .menu .item.collapse-button-wrapper { + &.sidebar { + overflow-y: visible !important; + background: var(--sidebar-background); + z-index: 1; + @include media(">desktop") { + display: flex; + flex-direction: column; + justify-content: space-between; + padding-bottom: 4em; + } + >nav { + flex-grow: 1; + overflow-y: auto; + } + @include media(">desktop") { + .menu .item.collapse-button-wrapper { + padding: 0; + } + .collapse.button { + display: none !important; + } + } + @include media("<=desktop") { + position: static !important; + width: 100% !important; + &.collapsed { + .player-wrapper, + .search, + .signup.segment, + nav.secondary { + display: none; + } + } + } + >div { + margin: 0; + background-color: var(--sidebar-background); + } + .menu.vertical { + background: transparent; + } + } + .ui.vertical.menu { + .item .item { + font-size: 1em; + >i.icon { + float: none; + margin: 0 0.5em 0 0; + } + } + .item.active { + border-right: 5px solid var(--vibrant-color); + border-radius: 0 !important; + background: var(--sidebar-active-item-background) !important; + } + .item.collapsed { + &:not(:focus)>.menu { + display: none; + } + .header { + margin-bottom: 0; + } + } + .collapsible.item .header { + cursor: pointer; + } + } + .ui.secondary.menu { + margin-left: 0; + margin-right: 0; + } + .tabs { + flex: 1; + display: flex; + flex-direction: column; + overflow-y: auto; + justify-content: space-between; + @include media("<=desktop") { + max-height: 500px; + } + } + .ui.tab.active { + display: flex; + } + .tab[data-tab="queue"] { + flex-direction: column; + tr { + cursor: pointer; + } + td:nth-child(2) { + width: 55px; + } + } + .item .header .angle.icon { + float: right; + margin: 0; + } + .tab[data-tab="library"] { + flex-direction: column; + flex: 1 1 auto; + >.menu { + flex: 1; + flex-grow: 1; + } + >.player-wrapper { + width: 100%; + } + } + .sidebar .segment { + margin: 0; + border-radius: 0; + } + .ui.menu .item.inline.admin-dropdown.dropdown>.menu { + left: 0; + right: auto; + } + .ui.segment.header-wrapper { + background: var(--sidebar-header-background); + color: var(--sidebar-header-color); + box-shadow: var(--sidebar-header-box-shadow); padding: 0; - } - .collapse.button { - display: none !important; - } - } - @include media("<=desktop") { - position: static !important; - width: 100% !important; - &.collapsed { - .player-wrapper, - .search, - .signup.segment, - nav.secondary { - display: none; - } - } - } - - > div { - margin: 0; - background-color: var(--sidebar-background); - } - .menu.vertical { - background: transparent; - } - } - - .ui.vertical.menu { - .item .item { - font-size: 1em; - > i.icon { - float: none; - margin: 0 0.5em 0 0; - } - } - .item.active { - border-right: 5px solid var(--vibrant-color); - border-radius: 0 !important; - background: var(--sidebar-active-item-background) !important; - } - .item.collapsed { - &:not(:focus) > .menu { - display: none; - } - .header { + display: flex; + justify-content: space-between; + align-items: center; + height: 4em; margin-bottom: 0; - } - } - .collaspable.item .header { - cursor: pointer; - } - } - .ui.secondary.menu { - margin-left: 0; - margin-right: 0; - } - .tabs { - flex: 1; - display: flex; - flex-direction: column; - overflow-y: auto; - justify-content: space-between; - @include media("<=desktop") { - max-height: 500px; - } - } - .ui.tab.active { - display: flex; - } - .tab[data-tab="queue"] { - flex-direction: column; - tr { - cursor: pointer; - } - td:nth-child(2) { - width: 55px; - } - } - .item .header .angle.icon { - float: right; - margin: 0; - } - .tab[data-tab="library"] { - flex-direction: column; - flex: 1 1 auto; - > .menu { - flex: 1; - flex-grow: 1; - } - > .player-wrapper { - width: 100%; - } - } - .sidebar .segment { - margin: 0; - border-radius: 0; - } - - .ui.menu .item.inline.admin-dropdown.dropdown > .menu { - left: 0; - right: auto; - } - .ui.segment.header-wrapper { - background: var(--sidebar-header-background); - color: var(--sidebar-header-color); - box-shadow: var(--sidebar-header-box-shadow); - padding: 0; - display: flex; - justify-content: space-between; - align-items: center; - height: 4em; - margin-bottom: 0; - nav { - > .item, > .menu > .item > .item { - &:hover { - background-color: transparent; + nav { + >.item, + >.menu>.item>.item { + &:hover { + background-color: transparent; + } + } } - } } - } - - nav.top.title-menu { - flex-grow: 1; - .item { - font-size: 1.5em; + nav.top.title-menu { + flex-grow: 1; + .item { + font-size: 1.5em; + } } - } - - .logo { - cursor: pointer; - display: inline-block; - margin: 0px; - } - - &.collapsed .search-wrapper { - @include media(" .item, > .right.menu > .item { - // color: rgba(255, 255, 255, 0.9) !important; - font-size: 1.2em; - &:hover, > .dropdown > .icon { - // color: rgba(255, 255, 255, 0.9) !important; - } - > .label, > .dropdown > .label { - font-size: 0.5em; - right: 1.7em; - bottom: -0.5em; - z-index: 0 !important; - } + &.collapsed .search-wrapper { + @include media(" .text > .label { - margin-right: 0; - } - .logo-wrapper { - display: inline-block; - margin: 0 auto; - @include media("tablet") { - img { - height: 1.5em; - } + .ui.mini.image { + width: 100%; } - } -} + nav.top { + align-items: self-end; + padding: 0.5em 0; + >.item, + >.right.menu>.item { + // color: rgba(255, 255, 255, 0.9) !important; + font-size: 1.2em; + &:hover, + >.dropdown>.icon { + // color: rgba(255, 255, 255, 0.9) !important; + } + >.label, + >.dropdown>.label { + font-size: 0.5em; + right: 1.7em; + bottom: -0.5em; + z-index: 0 !important; + } + } + } + .ui.user-dropdown>.text>.label { + margin-right: 0; + } + .logo-wrapper { + display: inline-block; + margin: 0 auto; + @include media("tablet") { + img { + height: 1.5em; + } + } + } +} \ No newline at end of file diff --git a/front/src/views/Search.vue b/front/src/views/Search.vue index 5ea8ebcc0..e1a1fd43f 100644 --- a/front/src/views/Search.vue +++ b/front/src/views/Search.vue @@ -43,11 +43,11 @@ -
+
-
+
{ if (t.id != this.currentType.id) { - axios.get(t.endpoint || t.id, {params: {q: this.query, page_size: 1}}).then(response => { + axios.get(t.endpoint || t.id, {params: { + q: this.query, + page_size: 1, + content_category: t.contentCategory, + include_channels: t.includeChannels, + }}).then(response => { this.results[t.id] = response.data }) } From 70054661c7076ba385715c08df174038f0815251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Fri, 4 Dec 2020 10:35:01 +0000 Subject: [PATCH 030/138] Added album filter to AlbumDetail vue for channel entries --- changes/changelog.d/1282.bugfix | 1 + front/src/components/library/AlbumDetail.vue | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changes/changelog.d/1282.bugfix diff --git a/changes/changelog.d/1282.bugfix b/changes/changelog.d/1282.bugfix new file mode 100644 index 000000000..5fb0a4e65 --- /dev/null +++ b/changes/changelog.d/1282.bugfix @@ -0,0 +1 @@ +Added an album filter to fix problem where channel entries would show up in the wrong series (#1282) \ No newline at end of file diff --git a/front/src/components/library/AlbumDetail.vue b/front/src/components/library/AlbumDetail.vue index b9d4821e6..2a4193762 100644 --- a/front/src/components/library/AlbumDetail.vue +++ b/front/src/components/library/AlbumDetail.vue @@ -4,7 +4,7 @@ Episodes Tracks - +