Workstream C: convert commands/download to a folder module, extract pinning and smart-cache commands
🏗️ Build and Test JellyTau / Build Android APK (push) Has been cancelled
🏗️ Build and Test JellyTau / Run Tests (push) Has been cancelled
Traceability Validation / Check Requirement Traces (push) Has been cancelled

- Move commands/download.rs to commands/download/mod.rs.
- Extract pin/unpin/is_pinned into download/pinning.rs.
- Extract smart-cache stats/config + album recommendation commands into
  download/smart_cache.rs.
- Re-exported via pub use so command names stay at commands::download::*;
  invoke_handler unchanged, all tests pass.
This commit is contained in:
2026-06-20 16:56:22 +02:00
parent e560258a4b
commit 642ec17069
5 changed files with 301 additions and 270 deletions
+7
View File
@@ -24,6 +24,7 @@ pub const TICKS_PER_SECOND: i64 = 10_000_000;
///
/// # Example
/// ```
/// # use jellytau_lib::utils::conversions::*;
/// let ticks = seconds_to_ticks(1.5); // 15,000,000 ticks
/// ```
#[inline]
@@ -41,6 +42,7 @@ pub fn seconds_to_ticks(seconds: f64) -> i64 {
///
/// # Example
/// ```
/// # use jellytau_lib::utils::conversions::*;
/// let seconds = ticks_to_seconds(15_000_000); // 1.5 seconds
/// ```
#[inline]
@@ -61,6 +63,7 @@ pub fn ticks_to_seconds(ticks: i64) -> f64 {
///
/// # Example
/// ```
/// # use jellytau_lib::utils::conversions::*;
/// let normalized = percent_to_volume(75.0); // 0.75
/// ```
#[inline]
@@ -81,6 +84,7 @@ pub fn percent_to_volume(percent: f64) -> f64 {
///
/// # Example
/// ```
/// # use jellytau_lib::utils::conversions::*;
/// let percent = volume_to_percent(0.75); // 75.0
/// ```
#[inline]
@@ -99,6 +103,7 @@ pub fn volume_to_percent(volume: f64) -> f64 {
///
/// # Example
/// ```
/// # use jellytau_lib::utils::conversions::*;
/// let formatted = format_time(225.0); // "3:45"
/// ```
pub fn format_time(seconds: f64) -> String {
@@ -121,6 +126,7 @@ pub fn format_time(seconds: f64) -> String {
///
/// # Example
/// ```
/// # use jellytau_lib::utils::conversions::*;
/// let short = format_time_long(225.0); // "3:45"
/// let long = format_time_long(5025.0); // "1:23:45"
/// ```
@@ -147,6 +153,7 @@ pub fn format_time_long(seconds: f64) -> String {
///
/// # Example
/// ```
/// # use jellytau_lib::utils::conversions::*;
/// let progress = calculate_progress(45.0, 180.0); // 25.0
/// ```
pub fn calculate_progress(position: f64, duration: f64) -> f64 {