Podcast support improvements. (#229)
* Added OpenUri D-BUS MPRIS support. Removed "user:" from URIType check because Spotify doesn't always provide it. * Added tags to .gitignore * Changed mpris metadata to actually return the track's url instead of the Spotify URI so that it matches the functionality of the official Spotify client. * Changed mpris:trackid and xesam:url to not use static naming so it can support podcasts. * Changed xesam:url to default to an empty string instead of "0" * Added possibility to start playing Shows and Episodes via MPRIS. Added possibility to search for Podcast Episodes.
This commit is contained in:
16
src/show.rs
16
src/show.rs
@@ -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;
|
||||
use rspotify::model::show::{SimplifiedShow, FullShow};
|
||||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -63,6 +63,20 @@ impl From<&SimplifiedShow> for Show {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&FullShow> for Show {
|
||||
fn from(show: &FullShow) -> Self {
|
||||
Self {
|
||||
id: show.id.clone(),
|
||||
uri: show.uri.clone(),
|
||||
name: show.name.clone(),
|
||||
publisher: show.publisher.clone(),
|
||||
description: show.description.clone(),
|
||||
cover_url: show.images.get(0).map(|i| i.url.clone()),
|
||||
episodes: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Show {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{} - {}", self.publisher, self.name)
|
||||
|
||||
Reference in New Issue
Block a user