mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 21:28:06 +00:00
feat: support separate album by disc (#861)
Co-authored-by: BakerBunker <bakerbunker@nwpu.edu.cn>
This commit is contained in:
parent
dfcae06496
commit
8b089e6cf4
1 changed files with 23 additions and 6 deletions
|
|
@ -71,12 +71,25 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<TrackList
|
<div v-if="Object.keys(tracksByDisc).length !== 1">
|
||||||
:id="album.id"
|
<div v-for="(disc, cd) in tracksByDisc" :key="cd">
|
||||||
:tracks="tracks"
|
<h2>Disc {{ cd }}</h2>
|
||||||
:type="'album'"
|
<TrackList
|
||||||
:album-object="album"
|
:id="album.id"
|
||||||
/>
|
:tracks="disc"
|
||||||
|
:type="'album'"
|
||||||
|
:album-object="album"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<TrackList
|
||||||
|
:id="album.id"
|
||||||
|
:tracks="tracks"
|
||||||
|
:type="'album'"
|
||||||
|
:album-object="album"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div class="extra-info">
|
<div class="extra-info">
|
||||||
<div class="album-time"></div>
|
<div class="album-time"></div>
|
||||||
<div class="release-date">
|
<div class="release-date">
|
||||||
|
|
@ -137,6 +150,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 ExplicitSymbol from '@/components/ExplicitSymbol.vue';
|
import ExplicitSymbol from '@/components/ExplicitSymbol.vue';
|
||||||
import ButtonTwoTone from '@/components/ButtonTwoTone.vue';
|
import ButtonTwoTone from '@/components/ButtonTwoTone.vue';
|
||||||
|
|
@ -204,6 +218,9 @@ export default {
|
||||||
return [...realAlbums, ...restItems].slice(0, 5);
|
return [...realAlbums, ...restItems].slice(0, 5);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
tracksByDisc() {
|
||||||
|
return groupBy(this.tracks, 'cd');
|
||||||
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.loadData(this.$route.params.id);
|
this.loadData(this.$route.params.id);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue