diff --git a/maple-rs/Cargo.lock b/maple-rs/Cargo.lock index ff1f935..010ebff 100644 --- a/maple-rs/Cargo.lock +++ b/maple-rs/Cargo.lock @@ -118,12 +118,6 @@ dependencies = [ "syn", ] -[[package]] -name = "bitflags" -version = "2.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" - [[package]] name = "bumpalo" version = "3.19.0" @@ -250,18 +244,6 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" -[[package]] -name = "fallible-iterator" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" - -[[package]] -name = "fallible-streaming-iterator" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" - [[package]] name = "flate2" version = "1.1.2" @@ -272,36 +254,12 @@ dependencies = [ "miniz_oxide", ] -[[package]] -name = "foldhash" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" - [[package]] name = "glob" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" -[[package]] -name = "hashbrown" -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" -dependencies = [ - "foldhash", -] - -[[package]] -name = "hashlink" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" -dependencies = [ - "hashbrown", -] - [[package]] name = "heck" version = "0.5.0" @@ -354,17 +312,6 @@ version = "0.2.175" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" -[[package]] -name = "libsqlite3-sys" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "133c182a6a2c87864fe97778797e46c7e999672690dc9fa3ee8e241aa4a9c13f" -dependencies = [ - "cc", - "pkg-config", - "vcpkg", -] - [[package]] name = "lofty" version = "0.21.1" @@ -404,7 +351,6 @@ dependencies = [ "binrw", "lofty", "rekordcrate", - "rusqlite", "walkdir", ] @@ -511,12 +457,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "pkg-config" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" - [[package]] name = "proc-macro2" version = "1.0.101" @@ -590,20 +530,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "rusqlite" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "165ca6e57b20e1351573e3729b958bc62f0e48025386970b6e4d29e7a7e71f3f" -dependencies = [ - "bitflags", - "fallible-iterator", - "fallible-streaming-iterator", - "hashlink", - "libsqlite3-sys", - "smallvec", -] - [[package]] name = "rustversion" version = "1.0.22" @@ -645,12 +571,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "smallvec" -version = "1.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" - [[package]] name = "static_assertions" version = "1.1.0" @@ -729,12 +649,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "walkdir" version = "2.5.0" diff --git a/maple-rs/Cargo.toml b/maple-rs/Cargo.toml index 2162f7e..e5eb6eb 100644 --- a/maple-rs/Cargo.toml +++ b/maple-rs/Cargo.toml @@ -4,15 +4,12 @@ version = "0.1.0" edition = "2024" [dependencies] -rekordcrate = { path = "/home/ntr/code/rekordcrate" } +# rekordcrate = { git = "ssh://git@github.com/ntwl-xyz/rekordcrate.git", branch = "db" } +rekordcrate = { path = "../../rekordcrate" } lofty = "0.21" walkdir = "2.4" binrw = "0.15" -[dependencies.rusqlite] -version = "0.37.0" -features = ["bundled-sqlcipher"] - [[bin]] name = "playlists" path = "src/playlists.rs" diff --git a/maple-rs/ntr.pdb b/maple-rs/ntr.pdb new file mode 100755 index 0000000..9b0cf29 Binary files /dev/null and b/maple-rs/ntr.pdb differ diff --git a/maple-rs/src/library.rs b/maple-rs/src/library.rs index c653b43..96ca4b0 100644 --- a/maple-rs/src/library.rs +++ b/maple-rs/src/library.rs @@ -4,7 +4,7 @@ use std::path::Path; use walkdir::WalkDir; fn main() { - let music_path = "data/maple"; + let music_path = "../data/maple"; if !Path::new(music_path).exists() { println!("Music directory {} not found", music_path); diff --git a/maple-rs/src/main.rs b/maple-rs/src/main.rs index 5555d7c..cb01304 100644 --- a/maple-rs/src/main.rs +++ b/maple-rs/src/main.rs @@ -11,5 +11,29 @@ fn main() -> rekordcrate::Result<()> { println!("{:?}", n); } + println!("{:?}", db.tracks.first_key_value()); + Ok(()) +} + + +#[cfg(test)] +mod tests { + use rekordcrate::pdb::string::DeviceSQLString; + use rekordcrate::pdb::ArtworkId; + use rekordcrate::pdb::KeyId; + use rekordcrate::pdb::LabelId; + use rekordcrate::pdb::GenreId; + use rekordcrate::pdb::AlbumId; + use rekordcrate::pdb::ArtistId; + use rekordcrate::util::ColorIndex; + use super::*; + use rekordcrate::pdb::{ + Header, PageType, PlaylistEntry, PlaylistTreeNode, PlaylistTreeNodeId, Row, Track, TrackId + }; + + #[test] + fn acemo() { + let track = Track { unknown1: 36, index_shift: 32, bitmask: 788224, sample_rate: 44100, composer_id: ArtistId(0), file_size: 14547692, unknown2: 67991645, unknown3: 42343, unknown4: 54995, artwork_id: ArtworkId(1), key_id: KeyId(1), orig_artist_id: ArtistId(0), label_id: LabelId(0), remixer_id: ArtistId(0), bitrate: 0, track_number: 7, tempo: 13299, genre_id: GenreId(0), album_id: AlbumId(1), artist_id: ArtistId(1), id: TrackId(1), disc_number: 0, play_count: 0, year: 2019, sample_depth: 16, duration: 436, unknown5: 41, color: ColorIndex::None, rating: 0, unknown6: 1, unknown7: 3, isrc: DeviceSQLString::empty(), unknown_string1: DeviceSQLString::empty(), unknown_string2: DeviceSQLString::empty(), unknown_string3: DeviceSQLString::empty(), unknown_string4: DeviceSQLString::empty(), message: DeviceSQLString::empty(), kuvo_public: DeviceSQLString::empty(), autoload_hotcues: DeviceSQLString::empty(), unknown_string5: DeviceSQLString::empty(), unknown_string6: DeviceSQLString::empty(), date_added: DeviceSQLString::empty(), release_date: DeviceSQLString::empty(), mix_name: DeviceSQLString::empty(), unknown_string7: DeviceSQLString::empty(), analyze_path: DeviceSQLString::empty(), analyze_date: DeviceSQLString::empty(), comment: DeviceSQLString::empty(), title: DeviceSQLString::empty(), unknown_string8: DeviceSQLString::empty(), filename: DeviceSQLString::empty(), file_path: DeviceSQLString::empty() }; + } } \ No newline at end of file diff --git a/maple.sublime-project b/maple.sublime-project index d516345..44ad785 100755 --- a/maple.sublime-project +++ b/maple.sublime-project @@ -5,7 +5,29 @@ "path": ".", }, { - "path": "/home/ntr/code/rekordcrate" + "path": "h:ome\\ntr\\code\\rekordcrate", + }, + { + "path": "C:\\Users\\ntr\\code\\rekordcrate", }, ], + "settings": + { + "cargo_build": + { + "paths": + { + "C:\\Users\\ntr\\code\\maple\\maple-rs": + { + "variants": + { + "run": + { + "target": "--bin maple" + } + } + } + } + } + }, }