diff --git a/changes/changelog.d/631.enhacement b/changes/changelog.d/631.enhacement
new file mode 100644
index 000000000..faafd8c2a
--- /dev/null
+++ b/changes/changelog.d/631.enhacement
@@ -0,0 +1 @@
+Add UI elements for multi-disc albums (#631)
diff --git a/front/src/App.vue b/front/src/App.vue
index c4c5edb03..6e6f45ff6 100644
--- a/front/src/App.vue
+++ b/front/src/App.vue
@@ -392,4 +392,12 @@ button.reset {
[role="button"] {
cursor: pointer;
}
+
+.left.floated {
+ float: left;
+}
+
+.right.floated {
+ float: right;
+}
diff --git a/front/src/components/library/Album.vue b/front/src/components/library/Album.vue
index 943aa9fc9..9a4adfafc 100644
--- a/front/src/components/library/Album.vue
+++ b/front/src/components/library/Album.vue
@@ -39,12 +39,27 @@
-
+
+
+ Volume %{ number }
+
+ Play all
+
+
+
+
+
+
+
User libraries
@@ -67,6 +82,17 @@ import LibraryWidget from "@/components/federation/LibraryWidget"
const FETCH_URL = "albums/"
+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)
+ }
+ return acc
+}
+
export default {
props: ["id"],
components: {
@@ -77,7 +103,8 @@ export default {
data() {
return {
isLoading: true,
- album: null
+ album: null,
+ discs: []
}
},
created() {
@@ -91,6 +118,7 @@ export default {
logger.default.debug('Fetching album "' + this.id + '"')
axios.get(url).then(response => {
self.album = backend.Album.clean(response.data)
+ self.discs = self.album.tracks.reduce(groupByDisc, [])
self.isLoading = false
})
}