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

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

            
9
pub struct PlaylistId;
10

            
11
single_item_command_request!(PlaylistId, "playlistid", SongId);
12

            
13
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
14
pub struct PlaylistIdResponse(Vec<PlaylistIdResponseEntry>);
15

            
16
impl PlaylistIdResponse {
17
    pub fn new(items: Vec<PlaylistIdResponseEntry>) -> Self {
18
        PlaylistIdResponse(items)
19
    }
20
}
21

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

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

            
46
impl CommandResponse for PlaylistIdResponse {
47
    fn into_response_enum(self) -> crate::Response {
48
        todo!()
49
    }
50

            
51
    fn from_response_enum(response: crate::Response) -> Option<Self> {
52
        todo!()
53
    }
54

            
55
    fn parse(parts: ResponseAttributes<'_>) -> Result<Self, ResponseParserError> {
56
        unimplemented!()
57
    }
58
}
59

            
60
impl Command for PlaylistId {
61
    type Request = PlaylistIdRequest;
62
    type Response = PlaylistIdResponse;
63
}