Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor: split runtime out of main.rs and fix native playback metada…
…ta (#218)
  • Loading branch information
LargeModGames committed May 5, 2026
commit bf0314dfb8a7a2f515b15068959130185215e695
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## [Unreleased]

### Fixed

- **Native streaming metadata freshness**: Kept native player track metadata authoritative while Spotify's playback API is still catching up, preventing stale API responses from overwriting the current native track and suppressing duplicate song-count, lyrics, and saved-track checks for stale items.

### Internal

- **Runtime module split**: Moved authentication, runtime startup, TUI runner, native player event handling, and shared playback metadata extraction out of the monolithic `main.rs` into focused `core`, `infra`, and `tui` modules.
- **Playback integration metadata sharing**: Centralized playback snapshot construction for Discord RPC, MPRIS, and macOS media integrations so native streaming and Spotify API metadata are resolved consistently.
- **Module path cleanup**: Updated imports to use the current `core`, `infra`, and `tui` module paths after the runtime split.

## [v0.38.1] - 2026-04-24

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/cli/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ impl Format {
Self::Position((curr, duration)) => {
let current_progress_ms = *curr as u128;
let duration = Duration::from_millis(*duration as u64);
crate::ui::util::display_track_progress(current_progress_ms, duration)
crate::tui::ui::util::display_track_progress(current_progress_ms, duration)
}
Self::Flags((r, s, l)) => {
let like = if *l {
Expand Down
6 changes: 3 additions & 3 deletions src/core/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -811,10 +811,10 @@ pub struct App {
pub is_volume_change_in_flight: bool,
/// Reference to the native streaming player for direct control (bypasses event channel)
#[cfg(feature = "streaming")]
pub streaming_player: Option<Arc<crate::player::StreamingPlayer>>,
pub streaming_player: Option<Arc<crate::infra::player::StreamingPlayer>>,
/// Reference to MPRIS manager for emitting Seeked signals after native seeks
#[cfg(all(feature = "mpris", target_os = "linux"))]
pub mpris_manager: Option<Arc<crate::mpris::MprisManager>>,
pub mpris_manager: Option<Arc<crate::infra::mpris::MprisManager>>,

// Create Playlist form state
pub create_playlist_name: Vec<char>,
Expand Down Expand Up @@ -2834,7 +2834,7 @@ impl App {
// Notify MPRIS clients of the change
#[cfg(all(feature = "mpris", target_os = "linux"))]
if let Some(ref mpris) = self.mpris_manager {
use crate::mpris::LoopStatusEvent;
use crate::infra::mpris::LoopStatusEvent;
let loop_status = match next_repeat_state {
RepeatState::Off => LoopStatusEvent::None,
RepeatState::Context => LoopStatusEvent::Playlist,
Expand Down
Loading
Loading