1
use serde::{Deserialize, Serialize};
2

            
3
use crate::{
4
    commands::{
5
        Command, CommandResponse, ResponseParserError, single_optional_item_command_request,
6
    },
7
    response_tokenizer::ResponseAttributes,
8
    types::{DbSongInfo, OneOrRange, Priority, SongId, SongPosition},
9
};
10

            
11
pub struct PlaylistInfo;
12

            
13
single_optional_item_command_request!(PlaylistInfo, "playlistinfo", OneOrRange);
14

            
15
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
16
pub struct PlaylistInfoResponse(Vec<PlaylistInfoResponseEntry>);
17

            
18
impl PlaylistInfoResponse {
19
    pub fn new(items: Vec<PlaylistInfoResponseEntry>) -> Self {
20
        PlaylistInfoResponse(items)
21
    }
22
}
23

            
24
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
25
pub struct PlaylistInfoResponseEntry {
26
    pub position: SongPosition,
27
    pub id: SongId,
28
    pub priority: Option<Priority>,
29
    pub song_info: DbSongInfo,
30
}
31

            
32
impl PlaylistInfoResponseEntry {
33
    pub fn new(
34
        position: SongPosition,
35
        id: SongId,
36
        priority: Option<Priority>,
37
        song_info: DbSongInfo,
38
    ) -> Self {
39
        PlaylistInfoResponseEntry {
40
            position,
41
            id,
42
            priority,
43
            song_info,
44
        }
45
    }
46
}
47

            
48
impl CommandResponse for PlaylistInfoResponse {
49
    fn into_response_enum(self) -> crate::Response {
50
        todo!()
51
    }
52

            
53
    fn from_response_enum(_response: crate::Response) -> Option<Self> {
54
        todo!()
55
    }
56

            
57
    fn parse(_parts: ResponseAttributes<'_>) -> Result<Self, ResponseParserError> {
58
        unimplemented!()
59
    }
60
}
61

            
62
impl Command for PlaylistInfo {
63
    type Request = PlaylistInfoRequest;
64
    type Response = PlaylistInfoResponse;
65
}