[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.

Re-add playlist editing

Kasper (Sep 26, 2024, 3:20 AM +0200) e62dbcb1 b439a028

+15 -23
+3 -11
src/components/TrackList.svelte
··· 24 24 track_lists_details_map, 25 25 move_tracks, 26 26 remove_from_playlist, 27 - tracklist_items_updated, 27 + tracklist_updated, 28 28 get_default_sort_desc, 29 29 delete_tracks_with_item_ids, 30 30 tracks_updated, 31 31 } from '../lib/data' 32 32 import { new_playback_instance, playing_id } from '../lib/player' 33 - import { 34 - get_duration, 35 - format_date, 36 - check_mouse_shortcut, 37 - check_shortcut, 38 - assert_unreachable, 39 - } from '../lib/helpers' 40 - import { append_to_user_queue, prepend_to_user_queue } from '../lib/queue' 33 + import { get_duration, format_date, check_mouse_shortcut, check_shortcut } from '../lib/helpers' 41 34 import { tracklist_actions } from '../lib/page' 42 35 import { ipc_listen, ipc_renderer } from '../lib/window' 43 36 import { onDestroy, onMount } from 'svelte' 44 37 import { dragged } from '../lib/drag-drop' 45 38 import * as dragGhost from './DragGhost.svelte' 46 39 import VirtualListBlock, { scroll_container_keydown } from './VirtualListBlock.svelte' 47 - import { open_track_info } from './TrackInfo.svelte' 48 40 import type { ItemId, Track } from 'ferrum-addon/addon' 49 41 import Cover from './Cover.svelte' 50 42 import Header from './Header.svelte' ··· 71 63 groupAlbumTracks: $group_album_tracks, 72 64 }) 73 65 } 74 - $: if ($tracklist_items_updated || $tracks_updated || true) { 66 + $: if ($tracklist_updated || $tracks_updated || true) { 75 67 tracks_page = methods.get_tracks_page({ 76 68 playlistId: params.playlist_id, 77 69 filterQuery: $filter,
+12 -12
src/lib/data.ts
··· 114 114 } 115 115 if (track_ids.length >= 1) { 116 116 call((addon) => addon.add_tracks_to_playlist(playlist_id, track_ids)) 117 - tracklist_items_updated.emit() 117 + tracklist_updated.emit() 118 118 methods.save() 119 119 } 120 120 } 121 121 export function remove_from_playlist(playlist_id: TrackListID, item_ids: ItemId[]) { 122 122 call((addon) => addon.remove_from_playlist(playlist_id, item_ids)) 123 - tracklist_items_updated.emit() 123 + tracklist_updated.emit() 124 124 methods.save() 125 125 } 126 126 export function delete_tracks_with_item_ids(item_ids: ItemId[]) { 127 127 call((addon) => addon.delete_tracks_with_item_ids(item_ids)) 128 - tracklist_items_updated.emit() 128 + tracklist_updated.emit() 129 129 queue.removeDeleted() 130 130 methods.save() 131 131 } ··· 143 143 methods.save() 144 144 } 145 145 export function update_playlist(id: string, name: string, description: string) { 146 - // call((addon) => addon.update_playlist(id, name, description)) 147 - // track_lists_details_map.refresh() 148 - // page.refresh_ids_and_keep_selection() 149 - // methods.save() 146 + call((addon) => addon.update_playlist(id, name, description)) 147 + track_lists_details_map.refresh() 148 + tracklist_updated.emit() 149 + methods.save() 150 150 } 151 151 export function move_playlist( 152 152 id: TrackListID, ··· 180 180 else err_state = 'skippable' 181 181 } 182 182 } 183 - tracklist_items_updated.emit() 183 + tracklist_updated.emit() 184 184 methods.save() 185 185 } 186 186 ··· 223 223 }, 224 224 addPlay: (id: TrackID) => { 225 225 call((data) => data.add_play(id)) 226 - tracklist_items_updated.emit() 226 + tracklist_updated.emit() 227 227 methods.save() 228 228 }, 229 229 addSkip: (id: TrackID) => { 230 230 call((data) => data.add_skip(id)) 231 - tracklist_items_updated.emit() 231 + tracklist_updated.emit() 232 232 methods.save() 233 233 }, 234 234 addPlayTime: (id: TrackID, start_time: MsSinceUnixEpoch, duration_ms: number) => { ··· 287 287 } 288 288 } 289 289 export const tracks_updated = create_refresh_store() 290 - export const tracklist_items_updated = create_refresh_store() 290 + export const tracklist_updated = create_refresh_store() 291 291 292 292 export function get_artists() { 293 293 return call((addon) => addon.get_artists()) 294 294 } 295 295 export function move_tracks(playlist_id: TrackListID, indexes: ItemId[], to_index: number) { 296 296 call((data) => data.move_tracks(playlist_id, indexes, to_index)) 297 - tracklist_items_updated.emit() 297 + tracklist_updated.emit() 298 298 methods.save() 299 299 }