mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 13:17:46 +00:00
feat: Added "Add to Playlist" on lyrics page (#1671)
This commit is contained in:
parent
0abd616ca1
commit
000cfda922
1 changed files with 26 additions and 1 deletions
|
|
@ -87,6 +87,12 @@
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
</button-icon>
|
</button-icon>
|
||||||
|
<button-icon
|
||||||
|
:title="$t('contextMenu.addToPlaylist')"
|
||||||
|
@click.native="addToPlaylist"
|
||||||
|
>
|
||||||
|
<svg-icon icon-class="plus" />
|
||||||
|
</button-icon>
|
||||||
<!-- <button-icon @click.native="openMenu" title="Menu"
|
<!-- <button-icon @click.native="openMenu" title="Menu"
|
||||||
><svg-icon icon-class="more"
|
><svg-icon icon-class="more"
|
||||||
/></button-icon> -->
|
/></button-icon> -->
|
||||||
|
|
@ -229,7 +235,9 @@ import { lyricParser } from '@/utils/lyrics';
|
||||||
import ButtonIcon from '@/components/ButtonIcon.vue';
|
import ButtonIcon from '@/components/ButtonIcon.vue';
|
||||||
import * as Vibrant from 'node-vibrant/dist/vibrant.worker.min.js';
|
import * as Vibrant from 'node-vibrant/dist/vibrant.worker.min.js';
|
||||||
import Color from 'color';
|
import Color from 'color';
|
||||||
|
import { isAccountLoggedIn } from '@/utils/auth';
|
||||||
import { hasListSource, getListSourcePath } from '@/utils/playList';
|
import { hasListSource, getListSourcePath } from '@/utils/playList';
|
||||||
|
import locale from '@/locale';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Lyrics',
|
name: 'Lyrics',
|
||||||
|
|
@ -332,8 +340,25 @@ export default {
|
||||||
clearInterval(this.lyricsInterval);
|
clearInterval(this.lyricsInterval);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['toggleLyrics']),
|
...mapMutations(['toggleLyrics', 'updateModal']),
|
||||||
...mapActions(['likeATrack']),
|
...mapActions(['likeATrack']),
|
||||||
|
addToPlaylist() {
|
||||||
|
if (!isAccountLoggedIn()) {
|
||||||
|
this.showToast(locale.t('toast.needToLogin'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$store.dispatch('fetchLikedPlaylist');
|
||||||
|
this.updateModal({
|
||||||
|
modalName: 'addTrackToPlaylistModal',
|
||||||
|
key: 'show',
|
||||||
|
value: true,
|
||||||
|
});
|
||||||
|
this.updateModal({
|
||||||
|
modalName: 'addTrackToPlaylistModal',
|
||||||
|
key: 'selectedTrackID',
|
||||||
|
value: this.currentTrack?.id,
|
||||||
|
});
|
||||||
|
},
|
||||||
playPrevTrack() {
|
playPrevTrack() {
|
||||||
this.player.playPrevTrack();
|
this.player.playPrevTrack();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue