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

Successful napi upgrade

Kasper (Sep 30, 2024, 10:42 PM +0200) ac1fd09d 48c70a4d

+42 -44
+4 -6
Cargo.lock
··· 632 632 633 633 [[package]] 634 634 name = "napi-derive" 635 - version = "2.16.12" 635 + version = "3.0.0-alpha.12" 636 636 source = "registry+https://github.com/rust-lang/crates.io-index" 637 - checksum = "17435f7a00bfdab20b0c27d9c56f58f6499e418252253081bfff448099da31d1" 637 + checksum = "fba9a47726fea1ade989a27d54f5420acaa546a648c870ad6951ff0288c44879" 638 638 dependencies = [ 639 - "cfg-if", 640 639 "convert_case", 641 640 "napi-derive-backend", 642 641 "proc-macro2", ··· 646 645 647 646 [[package]] 648 647 name = "napi-derive-backend" 649 - version = "1.0.74" 648 + version = "2.0.0-alpha.12" 650 649 source = "registry+https://github.com/rust-lang/crates.io-index" 651 - checksum = "967c485e00f0bf3b1bdbe510a38a4606919cf1d34d9a37ad41f25a81aa077abe" 650 + checksum = "76f227e9f34f058f563dbee327f94e176ff4c6f7b26c057e18336715cfd5c3c3" 652 651 dependencies = [ 653 652 "convert_case", 654 - "once_cell", 655 653 "proc-macro2", 656 654 "quote", 657 655 "regex",
+1 -1
Cargo.toml
··· 20 20 "async", 21 21 "anyhow", 22 22 ] } 23 - napi-derive = "2.15" 23 + napi-derive = "3.0.0-alpha.12" 24 24 serde = { version = "1.0", features = ["derive"] } 25 25 id3 = "1.8" 26 26 mp3-metadata = "0.3"
+35 -35
ferrum-addon/addon.d.ts
··· 3 3 4 4 /* auto-generated by NAPI-RS */ 5 5 6 - export declare function get_artists(): Array<string> 7 - export declare function load_data(isDev: boolean, localDataPath?: string | undefined | null, libraryPath?: string | undefined | null): void 6 + function get_artists(): Array<string> 7 + function load_data(isDev: boolean, localDataPath?: string | undefined | null, libraryPath?: string | undefined | null): void 8 8 export interface PathsJs { 9 9 libraryDir: string 10 10 tracksDir: string ··· 12 12 cacheDb: string 13 13 localDataDir: string 14 14 } 15 - export declare function get_paths(): PathsJs 16 - export declare function save(): void 15 + function get_paths(): PathsJs 16 + function save(): void 17 17 export interface ImportStatus { 18 18 errors: Array<string> 19 19 tracksCount: number 20 20 playlistsCount: number 21 21 } 22 - export declare function get_default_sort_desc(field: string): boolean 22 + function get_default_sort_desc(field: string): boolean 23 23 export interface Track { 24 24 size: number 25 25 duration: number ··· 119 119 playlistLength: number 120 120 itemIds: Array<ItemId> 121 121 } 122 - export declare function get_tracks_page(options: TracksPageOptions): TracksPage 122 + function get_tracks_page(options: TracksPageOptions): TracksPage 123 123 export interface TrackListDetails { 124 124 id: string 125 125 name: string ··· 127 127 /** Folders only */ 128 128 children?: Array<string> 129 129 } 130 - export declare function get_track_lists_details(): Record<string, TrackListDetails> 131 - export declare function get_track_list(id: string): TrackList 130 + function get_track_lists_details(): Record<string, TrackListDetails> 131 + function get_track_list(id: string): TrackList 132 132 /** Returns the deleted track lists, including folder children */ 133 - export declare function delete_track_list(id: string): void 134 - export declare function add_tracks_to_playlist(playlistId: string, trackIds: Array<string>): void 135 - export declare function playlist_filter_duplicates(playlistId: TrackID, ids: Array<string>): Array<TrackID> 136 - export declare function remove_from_playlist(playlistId: TrackID, itemIds: Array<ItemId>): void 137 - export declare function delete_tracks_with_item_ids(itemIds: Array<ItemId>): void 138 - export declare function new_playlist(name: string, description: string, isFolder: boolean, parentId: string): void 139 - export declare function update_playlist(id: string, name: string, description: string): void 140 - export declare function move_playlist(id: string, fromId: string, toId: string, toIndex: number): void 141 - export declare function move_tracks(playlistId: string, itemIds: Array<ItemId>, toIndex: number): void 133 + function delete_track_list(id: string): void 134 + function add_tracks_to_playlist(playlistId: string, trackIds: Array<string>): void 135 + function playlist_filter_duplicates(playlistId: TrackID, ids: Array<string>): Array<TrackID> 136 + function remove_from_playlist(playlistId: TrackID, itemIds: Array<ItemId>): void 137 + function delete_tracks_with_item_ids(itemIds: Array<ItemId>): void 138 + function new_playlist(name: string, description: string, isFolder: boolean, parentId: string): void 139 + function update_playlist(id: string, name: string, description: string): void 140 + function move_playlist(id: string, fromId: string, toId: string, toIndex: number): void 141 + function move_tracks(playlistId: string, itemIds: Array<ItemId>, toIndex: number): void 142 142 /** Returns `None` if the file does not have an image */ 143 - export declare function read_small_cover_async(path: string, index: number, cacheDbPath: string): Promise<Buffer | null> 144 - export declare function read_cover_async(trackId: string, index: number): Promise<ArrayBuffer | null> 143 + function read_small_cover_async(path: string, index: number, cacheDbPath: string): Promise<Buffer | null> 144 + function read_cover_async(trackId: string, index: number): Promise<ArrayBuffer | null> 145 145 export interface TrackMd { 146 146 name: string 147 147 artist: string ··· 158 158 bpm: string 159 159 comments: string 160 160 } 161 - export declare function get_track(id: string): Track 161 + function get_track(id: string): Track 162 162 export interface KeyedTrack { 163 163 id: TrackID 164 164 track: Track 165 165 } 166 - export declare function get_track_by_item_id(itemId: ItemId): KeyedTrack 167 - export declare function get_track_ids(itemIds: Array<ItemId>): Array<TrackID> 168 - export declare function track_exists(id: string): boolean 169 - export declare function add_play(trackId: string): void 170 - export declare function add_skip(trackId: string): void 171 - export declare function add_play_time(id: TrackID, start: MsSinceUnixEpoch, durMs: number): void 172 - export declare function import_file(path: string, now: MsSinceUnixEpoch): void 173 - export declare function load_tags(trackId: string): void 166 + function get_track_by_item_id(itemId: ItemId): KeyedTrack 167 + function get_track_ids(itemIds: Array<ItemId>): Array<TrackID> 168 + function track_exists(id: string): boolean 169 + function add_play(trackId: string): void 170 + function add_skip(trackId: string): void 171 + function add_play_time(id: TrackID, start: MsSinceUnixEpoch, durMs: number): void 172 + function import_file(path: string, now: MsSinceUnixEpoch): void 173 + function load_tags(trackId: string): void 174 174 export interface JsImage { 175 175 index: number 176 176 totalImages: number 177 177 mimeType: string 178 178 data: Buffer 179 179 } 180 - export declare function get_image(index: number): JsImage | null 181 - export declare function set_image(index: number, pathStr: string): void 182 - export declare function set_image_data(index: number, bytes: ArrayBuffer): void 183 - export declare function remove_image(index: number): void 184 - export declare function update_track_info(trackId: string, info: TrackMd): void 180 + function get_image(index: number): JsImage | null 181 + function set_image(index: number, pathStr: string): void 182 + function set_image_data(index: number, bytes: ArrayBuffer): void 183 + function remove_image(index: number): void 184 + function update_track_info(trackId: string, info: TrackMd): void 185 185 export interface ViewOptions { 186 186 shownPlaylistFolders: Array<string> 187 187 /** Empty is treated as default */ 188 188 columns: Array<string> 189 189 } 190 - export declare function load_view_options(): ViewOptions 191 - export declare function save_view_options(viewOptions: ViewOptions): void 190 + function load_view_options(): ViewOptions 191 + function save_view_options(viewOptions: ViewOptions): void 192 192 export declare class ItunesImport { 193 193 static new(): ItunesImport 194 194 start(path: string, tracksDir: string): Promise<ImportStatus>
+1 -1
src-native/library_types.rs
··· 477 477 pub children: Vec<TrackListID>, 478 478 } 479 479 480 - #[derive(Serialize, Deserialize, Debug)] 480 + #[derive(Serialize, Deserialize, Debug, Clone)] 481 481 #[non_exhaustive] 482 482 #[napi] 483 483 pub enum SpecialTrackListName {
+1 -1
src-native/tracks/cover.rs
··· 10 10 use image::{ImageEncoder, ImageFormat, ImageReader}; 11 11 use lazy_static::lazy_static; 12 12 use napi::bindgen_prelude::{Buffer, PromiseRaw}; 13 - use napi::{Env, JsBuffer, JsObject, Task}; 13 + use napi::{Env, JsBuffer, Task}; 14 14 use redb::{Database, TableDefinition}; 15 15 use std::fs; 16 16 use std::io::{BufWriter, Cursor};