[READ-ONLY] Mirror of https://github.com/probablykasper/ferrum. Music library app for Mac, Linux and Windows ferrum.kasper.space
electron linux macos music music-library music-player napi windows
0

Configure Feed

Select the types of activity you want to include in your feed.

Fix queue panel deleting/moving incorrect tracks

Kasper (Oct 26, 2024, 2:44 AM +0200) 0d0f06ee cafcf126

+15 -10
+3
CHANGELOG.md
··· 1 1 # Changelog 2 2 3 + ## Next 4 + - Fix queue panel deleting/moving incorrect tracks 5 + 3 6 ## 0.19.1 - 2024 Oct 25 4 7 - Fix folder playlists not closing 5 8 - Fix outline glitch
+12 -10
src/components/Queue.svelte
··· 30 30 31 31 let show_history = false 32 32 $: current_index = $queue.past.length 33 - $: up_next_index = show_history ? current_index + Number(!!$queue.current) : 0 33 + $: up_next_index = current_index + Number(!!$queue.current) 34 + $: first_visible_index = show_history ? 0 : up_next_index 34 35 $: autoplay_index = up_next_index + $queue.user_queue.length 35 36 36 37 let history_list: VirtualListBlock<QueueItem> ··· 82 83 83 84 function remove_from_queue() { 84 85 if (selection.items.size >= 1) { 85 - queue.removeIndexes(selection.get_selected_indexes()) 86 + const indexes = selection.get_selected_indexes().map((i) => i + first_visible_index) 87 + queue.removeIndexes(indexes) 86 88 } 87 89 } 88 90 onDestroy(ipc_listen('context.Remove from Queue', remove_from_queue)) ··· 118 120 let dragged_indexes: number[] = [] 119 121 function on_drag_start(e: DragEvent) { 120 122 if (e.dataTransfer) { 121 - dragged_indexes = selection.get_selected_indexes() 123 + dragged_indexes = selection.get_selected_indexes().map((i) => i + first_visible_index) 122 124 e.dataTransfer.effectAllowed = 'move' 123 125 if (dragged_indexes.length === 1) { 124 126 const track = get_track(get_by_queue_index(dragged_indexes[0]).id) ··· 253 255 </div> 254 256 </VirtualListBlock> 255 257 {#if $queue.current} 256 - {@const qi = $queue.past.length} 258 + {@const qi = current_index} 257 259 <!-- svelte-ignore a11y-click-events-have-key-events --> 258 260 <!-- svelte-ignore a11y-interactive-supports-focus --> 259 261 <div ··· 323 325 class="row" 324 326 role="row" 325 327 class:selected={$selection.has(item.qId)} 326 - on:mousedown={(e) => selection.handle_mousedown(e, qi)} 327 - on:contextmenu={(e) => selection.handle_contextmenu(e, qi)} 328 - on:click={(e) => selection.handle_click(e, qi)} 328 + on:mousedown={(e) => selection.handle_mousedown(e, qi - first_visible_index)} 329 + on:contextmenu={(e) => selection.handle_contextmenu(e, qi - first_visible_index)} 330 + on:click={(e) => selection.handle_click(e, qi - first_visible_index)} 329 331 draggable="true" 330 332 on:dragstart={on_drag_start} 331 333 on:dragover={(e) => on_drag_over(e, qi)} ··· 364 366 class="row" 365 367 role="row" 366 368 class:selected={$selection.has(item.qId)} 367 - on:mousedown={(e) => selection.handle_mousedown(e, qi)} 368 - on:contextmenu={(e) => selection.handle_contextmenu(e, qi)} 369 - on:click={(e) => selection.handle_click(e, qi)} 369 + on:mousedown={(e) => selection.handle_mousedown(e, qi - first_visible_index)} 370 + on:contextmenu={(e) => selection.handle_contextmenu(e, qi - first_visible_index)} 371 + on:click={(e) => selection.handle_click(e, qi - first_visible_index)} 370 372 draggable="true" 371 373 on:dragstart={on_drag_start} 372 374 on:dragover={(e) => on_drag_over(e, qi)}