Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mélanie Chauvel
funkwhale
Commits
aabcc3c5
Commit
aabcc3c5
authored
Oct 01, 2020
by
Ciarán Ainsworth
Committed by
Agate
Oct 04, 2020
Browse files
Resolve 1228 multi-disc albums
parent
0c5df9e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
changes/changelog.d/1228.bugfix
0 → 100644
View file @
aabcc3c5
Fixed duplication of discs for multi-disc albums in album views (#1228)
\ No newline at end of file
front/src/components/library/AlbumBase.vue
View file @
aabcc3c5
...
...
@@ -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
()
{
...
...
front/src/components/library/AlbumDetail.vue
View file @
aabcc3c5
...
...
@@ -7,12 +7,12 @@
<channel-entries
v-if=
"artist.channel && isSerie"
:limit=
"50"
:filters=
"
{channel: artist.channel.uuid, ordering: '-creation_date'}">
</channel-entries>
<template
v-else-if=
"discs && discs.length > 1"
>
<div
v-for=
"
(
tracks
, discNumber)
in discs"
:key=
"disc
N
umber"
>
<div
v-for=
"tracks in discs"
:key=
"
tracks.
disc
_n
umber"
>
<div
class=
"ui hidden divider"
></div>
<play-button
class=
"right floated mini inverted vibrant"
:tracks=
"tracks"
></play-button>
<translate
tag=
"h3"
:translate-params=
"
{number: disc
N
umber
+ 1
}"
:translate-params=
"
{number:
tracks[0].
disc
_n
umber}"
translate-context="Content/Album/"
>Volume %{ number }
</translate>
<album-entries
:tracks=
"tracks"
></album-entries>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment