cargo fmt
This commit is contained in:
@@ -2,7 +2,7 @@ use crate::library::Library;
|
||||
use crate::playable::Playable;
|
||||
use crate::queue::Queue;
|
||||
use crate::traits::{ListItem, ViewExt};
|
||||
use rspotify::model::show::{SimplifiedEpisode, FullEpisode};
|
||||
use rspotify::model::show::{FullEpisode, SimplifiedEpisode};
|
||||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
||||
12
src/mpris.rs
12
src/mpris.rs
@@ -9,14 +9,14 @@ use dbus::tree::{Access, Factory};
|
||||
use dbus::{Path, SignalArgs};
|
||||
|
||||
use crate::album::Album;
|
||||
use crate::episode::Episode;
|
||||
use crate::playable::Playable;
|
||||
use crate::playlist::Playlist;
|
||||
use crate::show::Show;
|
||||
use crate::queue::{Queue, RepeatSetting};
|
||||
use crate::show::Show;
|
||||
use crate::spotify::{PlayerEvent, Spotify, URIType};
|
||||
use crate::track::Track;
|
||||
use crate::traits::ListItem;
|
||||
use crate::episode::Episode;
|
||||
|
||||
type Metadata = HashMap<String, Variant<Box<dyn RefArg>>>;
|
||||
|
||||
@@ -28,7 +28,7 @@ fn get_playbackstatus(spotify: Arc<Spotify>) -> String {
|
||||
PlayerEvent::Paused => "Paused",
|
||||
_ => "Stopped",
|
||||
}
|
||||
.to_string()
|
||||
.to_string()
|
||||
}
|
||||
|
||||
fn get_metadata(playable: Option<Playable>) -> Metadata {
|
||||
@@ -130,7 +130,7 @@ fn run_dbus_server(spotify: Arc<Spotify>, queue: Arc<Queue>, rx: mpsc::Receiver<
|
||||
"org.mpris.MediaPlayer2.ncspot",
|
||||
dbus::NameFlag::ReplaceExisting as u32,
|
||||
)
|
||||
.expect("Failed to register dbus player name");
|
||||
.expect("Failed to register dbus player name");
|
||||
|
||||
let f = Factory::new_fn::<()>();
|
||||
|
||||
@@ -223,7 +223,7 @@ fn run_dbus_server(spotify: Arc<Spotify>, queue: Arc<Queue>, rx: mpsc::Receiver<
|
||||
RepeatSetting::RepeatTrack => "Track",
|
||||
RepeatSetting::RepeatPlaylist => "Playlist",
|
||||
}
|
||||
.to_string(),
|
||||
.to_string(),
|
||||
);
|
||||
Ok(())
|
||||
})
|
||||
@@ -573,7 +573,7 @@ fn run_dbus_server(spotify: Arc<Spotify>, queue: Arc<Queue>, rx: mpsc::Receiver<
|
||||
conn.send(
|
||||
changed.to_emit_message(&Path::new("/org/mpris/MediaPlayer2".to_string()).unwrap()),
|
||||
)
|
||||
.unwrap();
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::queue::Queue;
|
||||
use crate::spotify::Spotify;
|
||||
use crate::traits::{IntoBoxedViewExt, ListItem, ViewExt};
|
||||
use crate::ui::show::ShowView;
|
||||
use rspotify::model::show::{SimplifiedShow, FullShow};
|
||||
use rspotify::model::show::{FullShow, SimplifiedShow};
|
||||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ use crate::events::{Event, EventManager};
|
||||
use crate::playable::Playable;
|
||||
use crate::queue;
|
||||
use crate::track::Track;
|
||||
use rspotify::model::show::{Show, SimplifiedEpisode, FullShow, FullEpisode};
|
||||
use rspotify::model::show::{FullEpisode, FullShow, Show, SimplifiedEpisode};
|
||||
|
||||
pub const VOLUME_PERCENT: u16 = ((u16::max_value() as f64) * 1.0 / 100.0) as u16;
|
||||
|
||||
@@ -913,7 +913,7 @@ pub enum URIType {
|
||||
Track,
|
||||
Playlist,
|
||||
Show,
|
||||
Episode
|
||||
Episode,
|
||||
}
|
||||
|
||||
impl URIType {
|
||||
@@ -926,9 +926,9 @@ impl URIType {
|
||||
Some(URIType::Track)
|
||||
} else if s.starts_with("spotify:") && s.contains(":playlist:") {
|
||||
Some(URIType::Playlist)
|
||||
} else if s.starts_with("spotify:show:"){
|
||||
} else if s.starts_with("spotify:show:") {
|
||||
Some(URIType::Show)
|
||||
} else if s.starts_with("spotify:episode:"){
|
||||
} else if s.starts_with("spotify:episode:") {
|
||||
Some(URIType::Episode)
|
||||
} else {
|
||||
None
|
||||
|
||||
@@ -13,6 +13,7 @@ use crate::album::Album;
|
||||
use crate::artist::Artist;
|
||||
use crate::command::{Command, MoveMode};
|
||||
use crate::commands::CommandResult;
|
||||
use crate::episode::Episode;
|
||||
use crate::events::EventManager;
|
||||
use crate::library::Library;
|
||||
use crate::playlist::Playlist;
|
||||
@@ -25,7 +26,6 @@ use crate::ui::listview::{ListView, Pagination};
|
||||
use crate::ui::tabview::TabView;
|
||||
use rspotify::model::search::SearchResult;
|
||||
use rspotify::senum::SearchType;
|
||||
use crate::episode::Episode;
|
||||
|
||||
pub struct SearchView {
|
||||
results_tracks: Arc<RwLock<Vec<Track>>>,
|
||||
@@ -333,7 +333,7 @@ impl SearchView {
|
||||
let e = vec![result.into()];
|
||||
let mut r = episodes.write().unwrap();
|
||||
*r = e;
|
||||
return 1
|
||||
return 1;
|
||||
}
|
||||
0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user