fix: add model conversion, generic string arg

This commit is contained in:
ThetaDev 2023-03-10 19:04:27 +01:00
parent 3458924018
commit 630ea5960f
2 changed files with 17 additions and 6 deletions

View file

@ -1,7 +1,7 @@
use super::{
AlbumItem, ArtistId, ArtistItem, Channel, ChannelId, ChannelItem, ChannelTag, MusicArtist,
MusicItem, MusicPlaylistItem, PlaylistItem, PlaylistVideo, TrackItem, VideoId, VideoItem,
YouTubeItem,
AlbumItem, ArtistId, ArtistItem, Channel, ChannelId, ChannelItem, ChannelRssVideo, ChannelTag,
MusicArtist, MusicItem, MusicPlaylistItem, PlaylistItem, PlaylistVideo, TrackItem, VideoId,
VideoItem, YouTubeItem,
};
/// Trait for casting generic YouTube/YouTube music items to a specific kind.
@ -168,6 +168,15 @@ impl From<PlaylistVideo> for VideoId {
}
}
impl From<ChannelRssVideo> for VideoId {
fn from(video: ChannelRssVideo) -> Self {
Self {
id: video.id,
name: video.name,
}
}
}
impl From<TrackItem> for VideoId {
fn from(track: TrackItem) -> Self {
Self {