fix: increase default timeout to 20s, use ffmpeg copy arg
refactor: use enum for navigation endpoint
This commit is contained in:
parent
dc7bd7befc
commit
805cc5088f
11 changed files with 226 additions and 157 deletions
|
|
@ -37,6 +37,12 @@ impl FromYtItem for VideoItem {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<VideoItem> for YouTubeItem {
|
||||
fn from(value: VideoItem) -> Self {
|
||||
Self::Video(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl FromYtItem for PlaylistItem {
|
||||
fn from_yt_item(item: YouTubeItem) -> Option<Self> {
|
||||
match item {
|
||||
|
|
@ -46,6 +52,12 @@ impl FromYtItem for PlaylistItem {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<PlaylistItem> for YouTubeItem {
|
||||
fn from(value: PlaylistItem) -> Self {
|
||||
Self::Playlist(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl FromYtItem for ChannelItem {
|
||||
fn from_yt_item(item: YouTubeItem) -> Option<Self> {
|
||||
match item {
|
||||
|
|
@ -55,6 +67,12 @@ impl FromYtItem for ChannelItem {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<ChannelItem> for YouTubeItem {
|
||||
fn from(value: ChannelItem) -> Self {
|
||||
Self::Channel(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl FromYtItem for MusicItem {
|
||||
fn from_ytm_item(item: MusicItem) -> Option<Self> {
|
||||
Some(item)
|
||||
|
|
@ -70,6 +88,12 @@ impl FromYtItem for TrackItem {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<TrackItem> for MusicItem {
|
||||
fn from(value: TrackItem) -> Self {
|
||||
Self::Track(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl FromYtItem for AlbumItem {
|
||||
fn from_ytm_item(item: MusicItem) -> Option<Self> {
|
||||
match item {
|
||||
|
|
@ -79,6 +103,12 @@ impl FromYtItem for AlbumItem {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<AlbumItem> for MusicItem {
|
||||
fn from(value: AlbumItem) -> Self {
|
||||
Self::Album(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl FromYtItem for ArtistItem {
|
||||
fn from_ytm_item(item: MusicItem) -> Option<Self> {
|
||||
match item {
|
||||
|
|
@ -88,6 +118,12 @@ impl FromYtItem for ArtistItem {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<ArtistItem> for MusicItem {
|
||||
fn from(value: ArtistItem) -> Self {
|
||||
Self::Artist(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl FromYtItem for MusicPlaylistItem {
|
||||
fn from_ytm_item(item: MusicItem) -> Option<Self> {
|
||||
match item {
|
||||
|
|
@ -97,6 +133,12 @@ impl FromYtItem for MusicPlaylistItem {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<MusicPlaylistItem> for MusicItem {
|
||||
fn from(value: MusicPlaylistItem) -> Self {
|
||||
Self::Playlist(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> From<Channel<T>> for ChannelTag {
|
||||
fn from(channel: Channel<T>) -> Self {
|
||||
Self {
|
||||
|
|
|
|||
Reference in a new issue