[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 context menus

Kasper (Aug 31, 2022, 8:17 AM +0200) 1cf2eaf2 85493e98

+11 -6
+1 -1
.github/workflows/build.yml .github/workflows/ci.yml
··· 1 - name: Build 1 + name: CI 2 2 on: 3 3 push: 4 4 branches:
+3
CHANGELOG.md
··· 1 1 # Changelog 2 2 3 + ## Next 4 + - Fix context menus 5 + 3 6 ## 0.14.1 - 2022 Aug 31 4 7 - Fix app launch error 5 8 - Fix app exit when launch fails
+1 -1
src/components/Player.svelte
··· 51 51 prependToUserQueue([trackId]) 52 52 } else if (clickedId === 'Add to Queue') { 53 53 appendToUserQueue([trackId]) 54 - } else if (clickedId.startsWith('add-to-')) { 54 + } else if (clickedId?.startsWith('add-to-')) { 55 55 const pId = clickedId.substring('add-to-'.length) 56 56 addTracksToPlaylist(pId, [trackId]) 57 57 } else if (clickedId === 'revealTrackFile') {
+1 -1
src/components/Sidebar.svelte
··· 41 41 } 42 42 } 43 43 async function onContextMenu() { 44 - const clickedId = await ipcRenderer.invoke('showTracklistMenu', true, true) 44 + const clickedId = (await ipcRenderer.invoke('showTracklistMenu', true, true)) as string | null 45 45 if (clickedId === 'New Playlist') { 46 46 openNewPlaylistModal('root', false) 47 47 } else if (clickedId === 'New Folder') {
+1 -1
src/components/SidebarItems.svelte
··· 52 52 if ($page.id !== id) page.openPlaylist(id) 53 53 } 54 54 async function tracklistContextMenu(id: string, isFolder: boolean) { 55 - const clickedId = await ipcRenderer.invoke('showTracklistMenu', isFolder) 55 + const clickedId = (await ipcRenderer.invoke('showTracklistMenu', isFolder)) as string | null 56 56 if (clickedId === 'Edit Details') { 57 57 openEditPlaylistModal(id, isFolder) 58 58 } else if (clickedId === 'New Playlist') {
+3 -1
src/components/TrackList.svelte
··· 115 115 const indexes = selection.getSelectedIndexes($selection) 116 116 const ids = indexes.map((i) => page.getTrackId(i)) 117 117 const clickedId = await showTrackMenu($page.tracklist.type === 'playlist') 118 + console.log(clickedId) 119 + 118 120 if (clickedId === 'Play Next') { 119 121 prependToUserQueue(ids) 120 122 } else if (clickedId === 'Add to Queue') { 121 123 appendToUserQueue(ids) 122 - } else if (clickedId.startsWith('add-to-')) { 124 + } else if (clickedId?.startsWith('add-to-')) { 123 125 const pId = clickedId.substring('add-to-'.length) 124 126 addTracksToPlaylist(pId, ids) 125 127 } else if (clickedId === 'Remove from Playlist') {
+1 -1
src/lib/menus.ts
··· 8 8 const trackLists = get(trackListsStore) 9 9 const flat = flattenChildLists(trackLists.root as Special, trackLists, '', 'add-to-') 10 10 11 - const clickedId = await ipcRenderer.invoke('showTrackMenu', flat, playlist) 11 + const clickedId = (await ipcRenderer.invoke('showTrackMenu', flat, playlist)) as string | null 12 12 13 13 return clickedId 14 14 }