Skip to content

Commit

Permalink
[disc] Add discnumber to the disc model
Browse files Browse the repository at this point in the history
This allows us to distinguish between multiple discs within the same
album
  • Loading branch information
usox committed Feb 23, 2022
1 parent b248e24 commit 491ca46
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/components/Album/AlbumView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
</div>
<template v-if="albumDiscs !== null">
<div class="album" v-for="disc in albumDiscs" :key="disc.getId()">
<h3>
{{ $t('album.disc_title', { number: disc.getNumber() }) }}
</h3>
<table>
<thead>
<tr>
Expand Down
3 changes: 2 additions & 1 deletion src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"name_column_title": "Name",
"length_column_title": "Länge",
"year_column_title": "Jahr"
}
},
"disc_title": "CD {number}"
},
"artist_list": {
"title": "Künstler"
Expand Down
3 changes: 2 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"name_column_title": "Name",
"length_column_title": "Length",
"year_column_title": "Year"
}
},
"disc_title": "Disc {number}"
},
"artist_list": {
"title": "Artists"
Expand Down
6 changes: 6 additions & 0 deletions src/model/Disc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export default class Disc implements DiscInterface {

private length: number = 0;

private number: number = 0;

getId(): number | undefined {
return this.id;
}
Expand All @@ -22,4 +24,8 @@ export default class Disc implements DiscInterface {
getLength(): number {
return this.length;
}

getNumber(): number {
return this.number
}
}
2 changes: 2 additions & 0 deletions src/model/DiscInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ export default interface DiscInterface {
getSongList(): Array<SongListItemInterface>;

getLength(): number;

getNumber(): number;
}

0 comments on commit 491ca46

Please sign in to comment.