@@ -4,7 +4,7 @@ import { computed, ref } from 'vue';
4
4
5
5
import i18n from '@/../i18n/renderer' ;
6
6
import { getBilibiliAudioUrl } from '@/api/bilibili' ;
7
- import { getLikedList , getMusicLrc , getMusicUrl , getParsingMusicUrl } from '@/api/music' ;
7
+ import { getLikedList , getMusicLrc , getMusicUrl , getParsingMusicUrl , likeSong } from '@/api/music' ;
8
8
import { useMusicHistory } from '@/hooks/MusicHistoryHook' ;
9
9
import { audioService } from '@/services/audioService' ;
10
10
import type { ILyric , ILyricText , SongResult } from '@/type/music' ;
@@ -984,6 +984,7 @@ export const usePlayerStore = defineStore('player', () => {
984
984
if ( ! isAlreadyInList ) {
985
985
favoriteList . value . push ( id ) ;
986
986
localStorage . setItem ( 'favoriteList' , JSON . stringify ( favoriteList . value ) ) ;
987
+ typeof id === 'number' && likeSong ( id , true ) ;
987
988
}
988
989
} ;
989
990
@@ -993,6 +994,7 @@ export const usePlayerStore = defineStore('player', () => {
993
994
favoriteList . value = favoriteList . value . filter ( existingId => ! isBilibiliIdMatch ( existingId , id ) ) ;
994
995
} else {
995
996
favoriteList . value = favoriteList . value . filter ( existingId => existingId !== id ) ;
997
+ likeSong ( Number ( id ) , false ) ;
996
998
}
997
999
localStorage . setItem ( 'favoriteList' , JSON . stringify ( favoriteList . value ) ) ;
998
1000
} ;
0 commit comments