mirror of
https://github.com/Dangoware/dango-music-player.git
synced 2025-04-19 01:52:53 -05:00
Updated Queue and Main View song keys to include random numbers to prevent duplicates
This commit is contained in:
parent
8f30c38c4c
commit
fce2927986
1 changed files with 4 additions and 4 deletions
|
@ -48,14 +48,14 @@ function App() {
|
|||
const unlisten = appWindow.listen<any>("queue_updated", (_) => {
|
||||
// console.log(event);
|
||||
invoke('get_queue').then((_songs) => {
|
||||
let songs = _songs as any[]
|
||||
let songs = _songs as any[];
|
||||
setQueue(
|
||||
songs.filter((_, i) => i != 0).map((song, i) =>
|
||||
<QueueSong
|
||||
song={ song[0] }
|
||||
location={ song[1] as "Library" | {"Playlist" : string}}
|
||||
index={i+1}
|
||||
key={ song.uuid + '_' + Math.floor((Math.random() * 100_000) + 1) + '_' + Date.now() }
|
||||
key={ Math.floor((Math.random() * 100_000_000_000) + 1) + '_' + Date.now() }
|
||||
/>
|
||||
)
|
||||
)
|
||||
|
@ -126,7 +126,7 @@ function PlaylistHead({ playlists, setPlaylists, setViewName, setLibrary }: Play
|
|||
// console.log(song);
|
||||
return (
|
||||
<Song
|
||||
key={ song.uuid }
|
||||
key={ song.uuid + Math.floor(Math.random() * 100_000_000_000) }
|
||||
location={ song.location }
|
||||
playerLocation={ {"Playlist" : item.uuid } }
|
||||
uuid={ song.uuid }
|
||||
|
@ -221,7 +221,7 @@ function MainView({ lib_ref, viewName }: MainViewProps) {
|
|||
|
||||
return (
|
||||
<Song
|
||||
key={ song.uuid }
|
||||
key={ song.uuid + Math.floor(Math.random() * 100_000_000_000) }
|
||||
location={ song.location }
|
||||
playerLocation="Library"
|
||||
uuid={ song.uuid }
|
||||
|
|
Loading…
Reference in a new issue