45 lines
1.2 KiB
Rust
45 lines
1.2 KiB
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
use crate::{
|
|
commands::{
|
|
Command, CommandResponse, ResponseParserError,
|
|
single_optional_item_command_request,
|
|
},
|
|
response_tokenizer::ResponseAttributes,
|
|
types::{DbSongInfo, OneOrRange, Priority, SongId, SongPosition},
|
|
};
|
|
|
|
pub struct PlaylistInfo;
|
|
|
|
single_optional_item_command_request!(PlaylistInfo, "playlistinfo", OneOrRange);
|
|
|
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
|
pub struct PlaylistInfoResponse(Vec<PlaylistInfoResponseEntry>);
|
|
|
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
|
pub struct PlaylistInfoResponseEntry {
|
|
pub position: SongPosition,
|
|
pub id: SongId,
|
|
pub priority: Option<Priority>,
|
|
pub song_info: DbSongInfo,
|
|
}
|
|
|
|
impl CommandResponse for PlaylistInfoResponse {
|
|
fn into_response_enum(self) -> crate::Response {
|
|
todo!()
|
|
}
|
|
|
|
fn from_response_enum(response: crate::Response) -> Option<Self> {
|
|
todo!()
|
|
}
|
|
|
|
fn parse(_parts: ResponseAttributes<'_>) -> Result<Self, ResponseParserError> {
|
|
unimplemented!()
|
|
}
|
|
}
|
|
|
|
impl Command for PlaylistInfo {
|
|
type Request = PlaylistInfoRequest;
|
|
type Response = PlaylistInfoResponse;
|
|
}
|