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

Kasper (Sep 26, 2024, 3:20 AM +0200) 6bd08978 1a745ad4

+20 -21
+20 -21
src/lib/data.ts
··· 161 161 export const paths = call((addon) => addon.get_paths()) 162 162 163 163 export async function import_tracks(paths: string[]) { 164 - // let err_state = null 165 - // const now = Date.now() 166 - // for (const path of paths) { 167 - // try { 168 - // inner_addon.import_file(path, now) 169 - // } catch (err) { 170 - // if (err_state === 'skip') continue 171 - // const result = await ipc_renderer.invoke('showMessageBox', false, { 172 - // type: 'error', 173 - // message: 'Error importing track ' + path, 174 - // detail: get_error_message(err), 175 - // buttons: err_state ? ['OK', 'Skip all errors'] : ['OK'], 176 - // defaultId: 0, 177 - // }) 178 - // if (result.response === 1) err_state = 'skip' 179 - // else err_state = 'skippable' 180 - // } 181 - // } 182 - // page.refresh_ids_and_keep_selection() 183 - // pageSelection.clear() 184 - // methods.save() 164 + let err_state = null 165 + const now = Date.now() 166 + for (const path of paths) { 167 + try { 168 + inner_addon.import_file(path, now) 169 + } catch (err) { 170 + if (err_state === 'skip') continue 171 + const result = await ipc_renderer.invoke('showMessageBox', false, { 172 + type: 'error', 173 + message: 'Error importing track ' + path, 174 + detail: get_error_message(err), 175 + buttons: err_state ? ['OK', 'Skip all errors'] : ['OK'], 176 + defaultId: 0, 177 + }) 178 + if (result.response === 1) err_state = 'skip' 179 + else err_state = 'skippable' 180 + } 181 + } 182 + tracklist_items_updated.emit() 183 + methods.save() 185 184 } 186 185 187 186 export function get_default_sort_desc(field: string) {