From b56dac48042b4dca7d5a911409e0b736ad33e61c Mon Sep 17 00:00:00 2001 From: LeoRiether Date: Sat, 10 Feb 2024 11:55:12 -0300 Subject: [PATCH] Fixes --- tori/src/main.rs | 2 +- tori/src/state/browse_screen.rs | 12 +++++------- tori/src/update/mod.rs | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/tori/src/main.rs b/tori/src/main.rs index d515039..93e8ef6 100644 --- a/tori/src/main.rs +++ b/tori/src/main.rs @@ -33,7 +33,7 @@ async fn main() -> Result<()> { make_sure_playlist_dir_exists(); - let mut app = App::new()?; + let app = App::new()?; app.run().await } diff --git a/tori/src/state/browse_screen.rs b/tori/src/state/browse_screen.rs index 640f14e..5423bd9 100644 --- a/tori/src/state/browse_screen.rs +++ b/tori/src/state/browse_screen.rs @@ -1,4 +1,4 @@ -use crate::{app::filtered_list::FilteredList, config::Config, error::Result, m3u, input::Input}; +use crate::{app::filtered_list::FilteredList, config::Config, error::Result, input::Input, m3u}; use std::{io, result::Result as StdResult}; use tui::widgets::TableState; @@ -176,24 +176,22 @@ impl BrowseScreen { ///////////////////////////// pub fn select_next(&mut self) -> Result<()> { match self.focus { - Focus::Playlists => { + Focus::Playlists | Focus::PlaylistsFilter(_) => { self.shown_playlists.select_next(); self.refresh_songs()?; } - Focus::Songs => self.shown_songs.select_next(), - Focus::PlaylistsFilter(_) | Focus::SongsFilter(_) => {} + Focus::Songs | Focus::SongsFilter(_) => self.shown_songs.select_next(), } Ok(()) } pub fn select_prev(&mut self) -> Result<()> { match self.focus { - Focus::Playlists => { + Focus::Playlists | Focus::PlaylistsFilter(_) => { self.shown_playlists.select_prev(); self.refresh_songs()?; } - Focus::Songs => self.shown_songs.select_prev(), - Focus::PlaylistsFilter(_) | Focus::SongsFilter(_) => {} + Focus::Songs | Focus::SongsFilter(_) => self.shown_songs.select_prev(), } Ok(()) } diff --git a/tori/src/update/mod.rs b/tori/src/update/mod.rs index b6d9378..302303f 100644 --- a/tori/src/update/mod.rs +++ b/tori/src/update/mod.rs @@ -153,11 +153,11 @@ fn handle_command(state: &mut State<'_>, tx: Tx, cmd: Command) -> Result todo!(), Rename => todo!(), Delete => todo!(), + PlayFromModal => todo!(), SwapSongDown => todo!(), SwapSongUp => todo!(), - PlayFromModal => todo!(), OpenInEditor => todo!(), }