Remove unused code and fix compiler warnings
Some checks failed
Build and Release / build-and-release (push) Failing after 1m22s
Some checks failed
Build and Release / build-and-release (push) Failing after 1m22s
This commit is contained in:
parent
b535d0e9cb
commit
7b20b121d9
@ -130,11 +130,6 @@ impl Player {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn stop(&mut self) -> Result<()> {
|
|
||||||
self.send_command("stop", &[])?;
|
|
||||||
self.is_idle = true;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn set_volume(&mut self, volume: i64) -> Result<()> {
|
pub fn set_volume(&mut self, volume: i64) -> Result<()> {
|
||||||
self.send_command("set_property", &[json!("volume"), json!(volume)])?;
|
self.send_command("set_property", &[json!("volume"), json!(volume)])?;
|
||||||
@ -179,10 +174,6 @@ impl Player {
|
|||||||
Some(self.duration)
|
Some(self.duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_playing(&self) -> bool {
|
|
||||||
!self.is_paused && !self.is_idle
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn is_idle(&self) -> bool {
|
pub fn is_idle(&self) -> bool {
|
||||||
self.is_idle
|
self.is_idle
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,6 @@ pub struct AppState {
|
|||||||
pub struct FlattenedItem {
|
pub struct FlattenedItem {
|
||||||
pub node: FileTreeNode,
|
pub node: FileTreeNode,
|
||||||
pub depth: usize,
|
pub depth: usize,
|
||||||
pub is_expanded: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AppState {
|
impl AppState {
|
||||||
@ -120,20 +119,6 @@ impl AppState {
|
|||||||
self.flattened_items.get(self.selected_index)
|
self.flattened_items.get(self.selected_index)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn toggle_expand(&mut self) {
|
|
||||||
if let Some(item) = self.get_selected_item() {
|
|
||||||
if item.node.is_dir {
|
|
||||||
let path = item.node.path.clone();
|
|
||||||
if self.expanded_dirs.contains(&path) {
|
|
||||||
self.expanded_dirs.remove(&path);
|
|
||||||
} else {
|
|
||||||
self.expanded_dirs.insert(path);
|
|
||||||
}
|
|
||||||
self.rebuild_flattened_items();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn collapse_selected(&mut self) {
|
pub fn collapse_selected(&mut self) {
|
||||||
if let Some(item) = self.get_selected_item() {
|
if let Some(item) = self.get_selected_item() {
|
||||||
if item.node.is_dir {
|
if item.node.is_dir {
|
||||||
@ -167,10 +152,6 @@ impl AppState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn clear_marks(&mut self) {
|
|
||||||
self.marked_files.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn clear_playlist(&mut self) {
|
pub fn clear_playlist(&mut self) {
|
||||||
self.playlist.clear();
|
self.playlist.clear();
|
||||||
self.playlist_index = 0;
|
self.playlist_index = 0;
|
||||||
@ -469,7 +450,6 @@ fn flatten_tree(nodes: &[FileTreeNode], depth: usize, expanded_dirs: &HashSet<Pa
|
|||||||
result.push(FlattenedItem {
|
result.push(FlattenedItem {
|
||||||
node: node.clone(),
|
node: node.clone(),
|
||||||
depth,
|
depth,
|
||||||
is_expanded,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if node.is_dir && !node.children.is_empty() && is_expanded {
|
if node.is_dir && !node.children.is_empty() && is_expanded {
|
||||||
|
|||||||
@ -34,19 +34,7 @@ impl Theme {
|
|||||||
Color::Rgb(215, 175, 95) // #d7af5f
|
Color::Rgb(215, 175, 95) // #d7af5f
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn normal_red() -> Color {
|
|
||||||
Color::Rgb(215, 84, 0) // #d75400
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn normal_cyan() -> Color {
|
|
||||||
Color::Rgb(160, 160, 160) // #a0a0a0
|
|
||||||
}
|
|
||||||
|
|
||||||
// Semantic mappings
|
// Semantic mappings
|
||||||
pub fn primary_text() -> Color {
|
|
||||||
Color::Rgb(238, 238, 238) // #eeeeee
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn secondary_text() -> Color {
|
pub fn secondary_text() -> Color {
|
||||||
Self::foreground()
|
Self::foreground()
|
||||||
}
|
}
|
||||||
@ -75,10 +63,6 @@ impl Theme {
|
|||||||
Self::normal_yellow()
|
Self::normal_yellow()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn error() -> Color {
|
|
||||||
Self::normal_red()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Styles
|
// Styles
|
||||||
pub fn widget_border_style() -> Style {
|
pub fn widget_border_style() -> Style {
|
||||||
Style::default().fg(Self::border()).bg(Self::background())
|
Style::default().fg(Self::border()).bg(Self::background())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user