diff options
| author | salmonik <raisersoft@proton.me> | 2026-05-26 06:38:18 +0200 |
|---|---|---|
| committer | salmonik <raisersoft@proton.me> | 2026-05-26 06:38:18 +0200 |
| commit | 27f75fd8d3a6cc40c668b7251ed4d9c32d91fa6c (patch) | |
| tree | 254a77bd8b39fdbcb2584bc2ec6d69cd80636fde | |
| parent | Fix metadata extraction for symphonia 0.6 and add Albums shuffle mode (diff) | |
| download | rsplayer-27f75fd8d3a6cc40c668b7251ed4d9c32d91fa6c.tar.gz rsplayer-27f75fd8d3a6cc40c668b7251ed4d9c32d91fa6c.zip | |
bin size optimizations and queue stopping at the end of it
| -rw-r--r-- | .zed/tasks.json | 10 | ||||
| -rw-r--r-- | Cargo.lock | 108 | ||||
| -rw-r--r-- | Cargo.toml | 12 | ||||
| -rw-r--r-- | src/daemon.rs | 2 |
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 | ] |
| @@ -25,15 +25,6 @@ dependencies = [ | |||
| 25 | ] | 25 | ] |
| 26 | 26 | ||
| 27 | [[package]] | 27 | [[package]] |
| 28 | name = "android_system_properties" | ||
| 29 | version = "0.1.5" | ||
| 30 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 31 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" | ||
| 32 | dependencies = [ | ||
| 33 | "libc", | ||
| 34 | ] | ||
| 35 | |||
| 36 | [[package]] | ||
| 37 | name = "anstream" | 28 | name = "anstream" |
| 38 | version = "1.0.0" | 29 | version = "1.0.0" |
| 39 | source = "registry+https://github.com/rust-lang/crates.io-index" | 30 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -357,19 +348,6 @@ dependencies = [ | |||
| 357 | ] | 348 | ] |
| 358 | 349 | ||
| 359 | [[package]] | 350 | [[package]] |
| 360 | name = "chrono" | ||
| 361 | version = "0.4.44" | ||
| 362 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 363 | checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" | ||
| 364 | dependencies = [ | ||
| 365 | "iana-time-zone", | ||
| 366 | "js-sys", | ||
| 367 | "num-traits", | ||
| 368 | "wasm-bindgen", | ||
| 369 | "windows-link 0.2.1", | ||
| 370 | ] | ||
| 371 | |||
| 372 | [[package]] | ||
| 373 | name = "clap" | 351 | name = "clap" |
| 374 | version = "4.6.1" | 352 | version = "4.6.1" |
| 375 | source = "registry+https://github.com/rust-lang/crates.io-index" | 353 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -1067,30 +1045,6 @@ dependencies = [ | |||
| 1067 | ] | 1045 | ] |
| 1068 | 1046 | ||
| 1069 | [[package]] | 1047 | [[package]] |
| 1070 | name = "iana-time-zone" | ||
| 1071 | version = "0.1.65" | ||
| 1072 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1073 | checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" | ||
| 1074 | dependencies = [ | ||
| 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]] | ||
| 1085 | name = "iana-time-zone-haiku" | ||
| 1086 | version = "0.1.2" | ||
| 1087 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1088 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" | ||
| 1089 | dependencies = [ | ||
| 1090 | "cc", | ||
| 1091 | ] | ||
| 1092 | |||
| 1093 | [[package]] | ||
| 1094 | name = "icu_collections" | 1048 | name = "icu_collections" |
| 1095 | version = "2.2.0" | 1049 | version = "2.2.0" |
| 1096 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1050 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -1532,15 +1486,6 @@ dependencies = [ | |||
| 1532 | ] | 1486 | ] |
| 1533 | 1487 | ||
| 1534 | [[package]] | 1488 | [[package]] |
| 1535 | name = "num-integer" | ||
| 1536 | version = "0.1.46" | ||
| 1537 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1538 | checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" | ||
| 1539 | dependencies = [ | ||
| 1540 | "num-traits", | ||
| 1541 | ] | ||
| 1542 | |||
| 1543 | [[package]] | ||
| 1544 | name = "num-traits" | 1489 | name = "num-traits" |
| 1545 | version = "0.2.19" | 1490 | version = "0.2.19" |
| 1546 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1491 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -1778,15 +1723,6 @@ dependencies = [ | |||
| 1778 | ] | 1723 | ] |
| 1779 | 1724 | ||
| 1780 | [[package]] | 1725 | [[package]] |
| 1781 | name = "primal-check" | ||
| 1782 | version = "0.3.4" | ||
| 1783 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1784 | checksum = "dc0d895b311e3af9902528fbb8f928688abbd95872819320517cc24ca6b2bd08" | ||
| 1785 | dependencies = [ | ||
| 1786 | "num-integer", | ||
| 1787 | ] | ||
| 1788 | |||
| 1789 | [[package]] | ||
| 1790 | name = "proc-macro-crate" | 1726 | name = "proc-macro-crate" |
| 1791 | version = "3.5.0" | 1727 | version = "3.5.0" |
| 1792 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1728 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -2014,7 +1950,6 @@ dependencies = [ | |||
| 2014 | name = "rsp" | 1950 | name = "rsp" |
| 2015 | version = "0.8.1" | 1951 | version = "0.8.1" |
| 2016 | dependencies = [ | 1952 | dependencies = [ |
| 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]] |
| 2080 | name = "rustfft" | ||
| 2081 | version = "6.4.1" | ||
| 2082 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2083 | checksum = "21db5f9893e91f41798c88680037dba611ca6674703c1a18601b01a72c8adb89" | ||
| 2084 | dependencies = [ | ||
| 2085 | "num-complex", | ||
| 2086 | "num-integer", | ||
| 2087 | "num-traits", | ||
| 2088 | "primal-check", | ||
| 2089 | "strength_reduce", | ||
| 2090 | "transpose", | ||
| 2091 | ] | ||
| 2092 | |||
| 2093 | [[package]] | ||
| 2094 | name = "rustix" | 2013 | name = "rustix" |
| 2095 | version = "1.1.4" | 2014 | version = "1.1.4" |
| 2096 | source = "registry+https://github.com/rust-lang/crates.io-index" | 2015 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -2385,12 +2304,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 2385 | checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" | 2304 | checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" |
| 2386 | 2305 | ||
| 2387 | [[package]] | 2306 | [[package]] |
| 2388 | name = "strength_reduce" | ||
| 2389 | version = "0.2.4" | ||
| 2390 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2391 | checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" | ||
| 2392 | |||
| 2393 | [[package]] | ||
| 2394 | name = "strsim" | 2307 | name = "strsim" |
| 2395 | version = "0.11.1" | 2308 | version = "0.11.1" |
| 2396 | source = "registry+https://github.com/rust-lang/crates.io-index" | 2309 | source = "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]] |
| 2596 | name = "terminal_size" | ||
| 2597 | version = "0.4.4" | ||
| 2598 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2599 | checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" | ||
| 2600 | dependencies = [ | ||
| 2601 | "rustix", | ||
| 2602 | "windows-sys 0.61.2", | ||
| 2603 | ] | ||
| 2604 | |||
| 2605 | [[package]] | ||
| 2606 | name = "thiserror" | 2508 | name = "thiserror" |
| 2607 | version = "1.0.69" | 2509 | version = "1.0.69" |
| 2608 | source = "registry+https://github.com/rust-lang/crates.io-index" | 2510 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -2851,16 +2753,6 @@ dependencies = [ | |||
| 2851 | ] | 2753 | ] |
| 2852 | 2754 | ||
| 2853 | [[package]] | 2755 | [[package]] |
| 2854 | name = "transpose" | ||
| 2855 | version = "0.2.3" | ||
| 2856 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2857 | checksum = "1ad61aed86bc3faea4300c7aee358b4c6d0c8d6ccc36524c96e4c92ccf26e77e" | ||
| 2858 | dependencies = [ | ||
| 2859 | "num-integer", | ||
| 2860 | "strength_reduce", | ||
| 2861 | ] | ||
| 2862 | |||
| 2863 | [[package]] | ||
| 2864 | name = "try-lock" | 2756 | name = "try-lock" |
| 2865 | version = "0.2.5" | 2757 | version = "0.2.5" |
| 2866 | source = "registry+https://github.com/rust-lang/crates.io-index" | 2758 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| @@ -23,18 +23,22 @@ directories = "6.0" | |||
| 23 | serde = { version = "1.0.228", features = ["derive"] } | 23 | serde = { version = "1.0.228", features = ["derive"] } |
| 24 | toml = "1.1.2" | 24 | toml = "1.1.2" |
| 25 | reqwest = { version = "0.13.3", features = ["json", "form", "blocking"] } | 25 | reqwest = { version = "0.13.3", features = ["json", "form", "blocking"] } |
| 26 | symphonia = { version = "0.6", default-features = false, features = ["mp3", "flac", "vorbis", "wav", "ogg", "opt-simd", "id3v1", "id3v2", "ape"] } | 26 | symphonia = { version = "0.6", default-features = false, features = ["mp3", "flac", "vorbis", "wav", "ogg", "id3v1", "id3v2"] } |
| 27 | cpal = "0.17.3" | 27 | cpal = "0.17.3" |
| 28 | chrono = "0.4.44" | ||
| 29 | serde_json = "1.0.149" | 28 | serde_json = "1.0.149" |
| 30 | dirs = "6.0" | 29 | dirs = "6.0" |
| 31 | libc = "0.2.186" | 30 | libc = "0.2.186" |
| 32 | ctrlc = "3.5.2" | 31 | ctrlc = "3.5.2" |
| 33 | rand = "0.10.1" | 32 | rand = "0.10.1" |
| 34 | notify-rust = "4.17.0" | 33 | notify-rust = "4.17.0" |
| 35 | terminal_size = "0.4.4" | ||
| 36 | md-5 = "0.11.0" | 34 | md-5 = "0.11.0" |
| 37 | hex = "0.4.3" | 35 | hex = "0.4.3" |
| 38 | 36 | ||
| 37 | [profile.release] | ||
| 38 | opt-level = "z" | ||
| 39 | lto = true | ||
| 40 | codegen-units = 1 | ||
| 41 | strip = true | ||
| 42 | panic = "abort" | ||
| 43 | |||
| 39 | [dev-dependencies] | 44 | [dev-dependencies] |
| 40 | tempfile = "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 { |
