refactor: remove unused fields from AudioPlayerState

This commit is contained in:
2026-01-24 22:34:25 +03:00
parent 3e6a8b6e79
commit bd75ac6190
2 changed files with 0 additions and 30 deletions
-11
View File
@@ -43,17 +43,6 @@ pub struct AudioPlayerState {
pub tracks: Vec<TrackInfo>, pub tracks: Vec<TrackInfo>,
pub current_file_path: PathBuf,
pub is_paused: bool,
pub looped: bool,
pub volume: f32,
pub new_volume: Option<f32>,
pub position: f32,
pub new_position: Option<f32>,
pub duration: f32,
pub current_input: String, pub current_input: String,
pub all_inputs: HashMap<String, String>, pub all_inputs: HashMap<String, String>,
} }
-19
View File
@@ -139,26 +139,7 @@ pub fn start_app_state_thread(audio_player_state_shared: Arc<Mutex<AudioPlayerSt
None => state, None => state,
}; };
guard.tracks = tracks.clone(); guard.tracks = tracks.clone();
if let Some(last_track) = tracks.last() {
guard.current_file_path = last_track.path.clone();
guard.position = last_track.position;
guard.duration = last_track.duration.unwrap_or(1.0);
guard.looped = last_track.looped;
} else {
guard.current_file_path = PathBuf::new();
guard.position = 0.0;
guard.duration = 1.0;
guard.looped = false;
}
guard.is_paused = is_paused;
guard.volume = match guard.new_volume {
Some(new_volume) => {
guard.new_volume = None;
new_volume
}
None => volume,
};
guard.current_input = current_input; guard.current_input = current_input;
guard.all_inputs = all_inputs; guard.all_inputs = all_inputs;
} }