aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalmonik <raisersoft@proton.me>2026-05-26 06:38:18 +0200
committersalmonik <raisersoft@proton.me>2026-05-26 06:38:18 +0200
commit27f75fd8d3a6cc40c668b7251ed4d9c32d91fa6c (patch)
tree254a77bd8b39fdbcb2584bc2ec6d69cd80636fde
parentFix metadata extraction for symphonia 0.6 and add Albums shuffle mode (diff)
downloadrsplayer-27f75fd8d3a6cc40c668b7251ed4d9c32d91fa6c.tar.gz
rsplayer-27f75fd8d3a6cc40c668b7251ed4d9c32d91fa6c.zip
bin size optimizations and queue stopping at the end of it
-rw-r--r--.zed/tasks.json10
-rw-r--r--Cargo.lock108
-rw-r--r--Cargo.toml12
-rw-r--r--src/daemon.rs2
4 files changed, 20 insertions, 112 deletions
diff --git a/.zed/tasks.json b/.zed/tasks.json
index 9bae85b..70d637f 100644
--- a/.zed/tasks.json
+++ b/.zed/tasks.json
@@ -4,17 +4,27 @@
4 "command": "cargo tarpaulin", 4 "command": "cargo tarpaulin",
5 "show_command": false, 5 "show_command": false,
6 "show_summary": false, 6 "show_summary": false,
7 "save": "all",
7 }, 8 },
8 { 9 {
9 "label": "run tests", 10 "label": "run tests",
10 "command": "cargo test", 11 "command": "cargo test",
11 "show_command": false, 12 "show_command": false,
12 "show_summary": false, 13 "show_summary": false,
14 "save": "all",
13 }, 15 },
14 { 16 {
15 "label": "install", 17 "label": "install",
16 "command": "./install.sh", 18 "command": "./install.sh",
17 "show_command": false, 19 "show_command": false,
18 "show_summary": false, 20 "show_summary": false,
21 "save": "all",
22 },
23 {
24 "label": "build release",
25 "command": "cargo b -r && ls -lha $ZED_WORKTREE_ROOT/target/release/rsp | awk '{print $5}'",
26 "show_command": false,
27 "show_summary": false,
28 "save": "all",
19 }, 29 },
20] 30]
diff --git a/Cargo.lock b/Cargo.lock
index f2593f8..50e1cbf 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -25,15 +25,6 @@ dependencies = [
25] 25]
26 26
27[[package]] 27[[package]]
28name = "android_system_properties"
29version = "0.1.5"
30source = "registry+https://github.com/rust-lang/crates.io-index"
31checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
32dependencies = [
33 "libc",
34]
35
36[[package]]
37name = "anstream" 28name = "anstream"
38version = "1.0.0" 29version = "1.0.0"
39source = "registry+https://github.com/rust-lang/crates.io-index" 30source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -357,19 +348,6 @@ dependencies = [
357] 348]
358 349
359[[package]] 350[[package]]
360name = "chrono"
361version = "0.4.44"
362source = "registry+https://github.com/rust-lang/crates.io-index"
363checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0"
364dependencies = [
365 "iana-time-zone",
366 "js-sys",
367 "num-traits",
368 "wasm-bindgen",
369 "windows-link 0.2.1",
370]
371
372[[package]]
373name = "clap" 351name = "clap"
374version = "4.6.1" 352version = "4.6.1"
375source = "registry+https://github.com/rust-lang/crates.io-index" 353source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1067,30 +1045,6 @@ dependencies = [
1067] 1045]
1068 1046
1069[[package]] 1047[[package]]
1070name = "iana-time-zone"
1071version = "0.1.65"
1072source = "registry+https://github.com/rust-lang/crates.io-index"
1073checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470"
1074dependencies = [
1075 "android_system_properties",
1076 "core-foundation-sys",
1077 "iana-time-zone-haiku",
1078 "js-sys",
1079 "log",
1080 "wasm-bindgen",
1081 "windows-core 0.62.2",
1082]
1083
1084[[package]]
1085name = "iana-time-zone-haiku"
1086version = "0.1.2"
1087source = "registry+https://github.com/rust-lang/crates.io-index"
1088checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
1089dependencies = [
1090 "cc",
1091]
1092
1093[[package]]
1094name = "icu_collections" 1048name = "icu_collections"
1095version = "2.2.0" 1049version = "2.2.0"
1096source = "registry+https://github.com/rust-lang/crates.io-index" 1050source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1532,15 +1486,6 @@ dependencies = [
1532] 1486]
1533 1487
1534[[package]] 1488[[package]]
1535name = "num-integer"
1536version = "0.1.46"
1537source = "registry+https://github.com/rust-lang/crates.io-index"
1538checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
1539dependencies = [
1540 "num-traits",
1541]
1542
1543[[package]]
1544name = "num-traits" 1489name = "num-traits"
1545version = "0.2.19" 1490version = "0.2.19"
1546source = "registry+https://github.com/rust-lang/crates.io-index" 1491source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1778,15 +1723,6 @@ dependencies = [
1778] 1723]
1779 1724
1780[[package]] 1725[[package]]
1781name = "primal-check"
1782version = "0.3.4"
1783source = "registry+https://github.com/rust-lang/crates.io-index"
1784checksum = "dc0d895b311e3af9902528fbb8f928688abbd95872819320517cc24ca6b2bd08"
1785dependencies = [
1786 "num-integer",
1787]
1788
1789[[package]]
1790name = "proc-macro-crate" 1726name = "proc-macro-crate"
1791version = "3.5.0" 1727version = "3.5.0"
1792source = "registry+https://github.com/rust-lang/crates.io-index" 1728source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2014,7 +1950,6 @@ dependencies = [
2014name = "rsp" 1950name = "rsp"
2015version = "0.8.1" 1951version = "0.8.1"
2016dependencies = [ 1952dependencies = [
2017 "chrono",
2018 "clap", 1953 "clap",
2019 "clap_complete", 1954 "clap_complete",
2020 "cpal", 1955 "cpal",
@@ -2031,8 +1966,6 @@ dependencies = [
2031 "serde", 1966 "serde",
2032 "serde_json", 1967 "serde_json",
2033 "symphonia", 1968 "symphonia",
2034 "tempfile",
2035 "terminal_size",
2036 "toml", 1969 "toml",
2037] 1970]
2038 1971
@@ -2077,20 +2010,6 @@ dependencies = [
2077] 2010]
2078 2011
2079[[package]] 2012[[package]]
2080name = "rustfft"
2081version = "6.4.1"
2082source = "registry+https://github.com/rust-lang/crates.io-index"
2083checksum = "21db5f9893e91f41798c88680037dba611ca6674703c1a18601b01a72c8adb89"
2084dependencies = [
2085 "num-complex",
2086 "num-integer",
2087 "num-traits",
2088 "primal-check",
2089 "strength_reduce",
2090 "transpose",
2091]
2092
2093[[package]]
2094name = "rustix" 2013name = "rustix"
2095version = "1.1.4" 2014version = "1.1.4"
2096source = "registry+https://github.com/rust-lang/crates.io-index" 2015source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2385,12 +2304,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
2385checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" 2304checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
2386 2305
2387[[package]] 2306[[package]]
2388name = "strength_reduce"
2389version = "0.2.4"
2390source = "registry+https://github.com/rust-lang/crates.io-index"
2391checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82"
2392
2393[[package]]
2394name = "strsim" 2307name = "strsim"
2395version = "0.11.1" 2308version = "0.11.1"
2396source = "registry+https://github.com/rust-lang/crates.io-index" 2309source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2474,7 +2387,6 @@ dependencies = [
2474 "lazy_static", 2387 "lazy_static",
2475 "log", 2388 "log",
2476 "num-complex", 2389 "num-complex",
2477 "rustfft",
2478 "smallvec", 2390 "smallvec",
2479] 2391]
2480 2392
@@ -2593,16 +2505,6 @@ dependencies = [
2593] 2505]
2594 2506
2595[[package]] 2507[[package]]
2596name = "terminal_size"
2597version = "0.4.4"
2598source = "registry+https://github.com/rust-lang/crates.io-index"
2599checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874"
2600dependencies = [
2601 "rustix",
2602 "windows-sys 0.61.2",
2603]
2604
2605[[package]]
2606name = "thiserror" 2508name = "thiserror"
2607version = "1.0.69" 2509version = "1.0.69"
2608source = "registry+https://github.com/rust-lang/crates.io-index" 2510source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2851,16 +2753,6 @@ dependencies = [
2851] 2753]
2852 2754
2853[[package]] 2755[[package]]
2854name = "transpose"
2855version = "0.2.3"
2856source = "registry+https://github.com/rust-lang/crates.io-index"
2857checksum = "1ad61aed86bc3faea4300c7aee358b4c6d0c8d6ccc36524c96e4c92ccf26e77e"
2858dependencies = [
2859 "num-integer",
2860 "strength_reduce",
2861]
2862
2863[[package]]
2864name = "try-lock" 2756name = "try-lock"
2865version = "0.2.5" 2757version = "0.2.5"
2866source = "registry+https://github.com/rust-lang/crates.io-index" 2758source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index 62acef4..9c2dda2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,18 +23,22 @@ directories = "6.0"
23serde = { version = "1.0.228", features = ["derive"] } 23serde = { version = "1.0.228", features = ["derive"] }
24toml = "1.1.2" 24toml = "1.1.2"
25reqwest = { version = "0.13.3", features = ["json", "form", "blocking"] } 25reqwest = { version = "0.13.3", features = ["json", "form", "blocking"] }
26symphonia = { version = "0.6", default-features = false, features = ["mp3", "flac", "vorbis", "wav", "ogg", "opt-simd", "id3v1", "id3v2", "ape"] } 26symphonia = { version = "0.6", default-features = false, features = ["mp3", "flac", "vorbis", "wav", "ogg", "id3v1", "id3v2"] }
27cpal = "0.17.3" 27cpal = "0.17.3"
28chrono = "0.4.44"
29serde_json = "1.0.149" 28serde_json = "1.0.149"
30dirs = "6.0" 29dirs = "6.0"
31libc = "0.2.186" 30libc = "0.2.186"
32ctrlc = "3.5.2" 31ctrlc = "3.5.2"
33rand = "0.10.1" 32rand = "0.10.1"
34notify-rust = "4.17.0" 33notify-rust = "4.17.0"
35terminal_size = "0.4.4"
36md-5 = "0.11.0" 34md-5 = "0.11.0"
37hex = "0.4.3" 35hex = "0.4.3"
38 36
37[profile.release]
38opt-level = "z"
39lto = true
40codegen-units = 1
41strip = true
42panic = "abort"
43
39[dev-dependencies] 44[dev-dependencies]
40tempfile = "3.17"
diff --git a/src/daemon.rs b/src/daemon.rs
index b18ecc9..48330ae 100644
--- a/src/daemon.rs
+++ b/src/daemon.rs
@@ -346,6 +346,7 @@ pub fn start_daemon() -> Result<(), Box<dyn std::error::Error>> {
346 notification::notify_error("Playback failed"); 346 notification::notify_error("Playback failed");
347 } else { 347 } else {
348 notification::notify_queue_ended(); 348 notification::notify_queue_ended();
349 q.clear();
349 } 350 }
350 } 351 }
351 } 352 }
@@ -600,6 +601,7 @@ fn process_command(
600 } else { 601 } else {
601 audio.stop(); 602 audio.stop();
602 notification::notify_queue_ended(); 603 notification::notify_queue_ended();
604 q.clear();
603 "Queue empty, stopped\n".to_string() 605 "Queue empty, stopped\n".to_string()
604 } 606 }
605 } else { 607 } else {