|
|
@ -71,12 +71,12 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="Object.keys(tracksByDisc).length !== 1">
|
|
|
|
<div v-if="tracksByDisc.length > 1">
|
|
|
|
<div v-for="(disc, cd) in tracksByDisc" :key="cd">
|
|
|
|
<div v-for="item in tracksByDisc" :key="item.disc">
|
|
|
|
<h2 class="disc">Disc {{ cd }}</h2>
|
|
|
|
<h2 class="disc">Disc {{ item.disc }}</h2>
|
|
|
|
<TrackList
|
|
|
|
<TrackList
|
|
|
|
:id="album.id"
|
|
|
|
:id="album.id"
|
|
|
|
:tracks="disc"
|
|
|
|
:tracks="item.tracks"
|
|
|
|
:type="'album'"
|
|
|
|
:type="'album'"
|
|
|
|
:album-object="album"
|
|
|
|
:album-object="album"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
@ -153,7 +153,7 @@ import locale from '@/locale';
|
|
|
|
import { splitSoundtrackAlbumTitle, splitAlbumTitle } from '@/utils/common';
|
|
|
|
import { splitSoundtrackAlbumTitle, splitAlbumTitle } from '@/utils/common';
|
|
|
|
import NProgress from 'nprogress';
|
|
|
|
import NProgress from 'nprogress';
|
|
|
|
import { isAccountLoggedIn } from '@/utils/auth';
|
|
|
|
import { isAccountLoggedIn } from '@/utils/auth';
|
|
|
|
import { groupBy } from 'lodash';
|
|
|
|
import { groupBy, toPairs, sortBy } from 'lodash';
|
|
|
|
|
|
|
|
|
|
|
|
import ExplicitSymbol from '@/components/ExplicitSymbol.vue';
|
|
|
|
import ExplicitSymbol from '@/components/ExplicitSymbol.vue';
|
|
|
|
import ButtonTwoTone from '@/components/ButtonTwoTone.vue';
|
|
|
|
import ButtonTwoTone from '@/components/ButtonTwoTone.vue';
|
|
|
@ -222,7 +222,12 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tracksByDisc() {
|
|
|
|
tracksByDisc() {
|
|
|
|
return groupBy(this.tracks, 'cd');
|
|
|
|
if (this.tracks.length <= 1) return [];
|
|
|
|
|
|
|
|
const pairs = toPairs(groupBy(this.tracks, 'cd'));
|
|
|
|
|
|
|
|
return sortBy(pairs, p => p[0]).map(items => ({
|
|
|
|
|
|
|
|
disc: items[0],
|
|
|
|
|
|
|
|
tracks: items[1],
|
|
|
|
|
|
|
|
}));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|