1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
//! Media command definitions (shows, episodes, audiobooks, chapters, albums).
use clap::Subcommand;
use crate::constants::{DEFAULT_LIMIT, DEFAULT_OFFSET};
#[derive(Subcommand)]
pub enum ShowCommand {
/// Get show (podcast) details
Get {
/// Show ID or URL
id: String,
},
/// List show episodes
Episodes {
/// Show ID or URL
id: String,
/// Number of episodes to return (default 20, max 50)
#[arg(long, short = 'l', default_value_t = DEFAULT_LIMIT)]
limit: u8,
/// Offset for pagination
#[arg(long, short = 'o', default_value_t = DEFAULT_OFFSET)]
offset: u32,
},
/// List saved shows
List {
/// Number of shows to return (default 20, max 50)
#[arg(long, short = 'l', default_value_t = DEFAULT_LIMIT)]
limit: u8,
/// Offset for pagination
#[arg(long, short = 'o', default_value_t = DEFAULT_OFFSET)]
offset: u32,
},
/// Save shows to library
Save {
/// Show IDs to save
#[arg(required = true)]
ids: Vec<String>,
},
/// Remove shows from library
Remove {
/// Show IDs to remove
#[arg(required = true)]
ids: Vec<String>,
},
/// Check if shows are in library
Check {
/// Show IDs to check
#[arg(required = true)]
ids: Vec<String>,
},
}
#[derive(Subcommand)]
pub enum EpisodeCommand {
/// Get episode details
Get {
/// Episode ID or URL
id: String,
},
/// List saved episodes
List {
/// Number of episodes to return (default 20, max 50)
#[arg(long, short = 'l', default_value_t = DEFAULT_LIMIT)]
limit: u8,
/// Offset for pagination
#[arg(long, short = 'o', default_value_t = DEFAULT_OFFSET)]
offset: u32,
},
/// Save episodes to library
Save {
/// Episode IDs to save
#[arg(required = true)]
ids: Vec<String>,
},
/// Remove episodes from library
Remove {
/// Episode IDs to remove
#[arg(required = true)]
ids: Vec<String>,
},
/// Check if episodes are in library
Check {
/// Episode IDs to check
#[arg(required = true)]
ids: Vec<String>,
},
}
#[derive(Subcommand)]
pub enum AudiobookCommand {
/// Get audiobook details
Get {
/// Audiobook ID or URL
id: String,
},
/// List audiobook chapters
Chapters {
/// Audiobook ID or URL
id: String,
/// Number of chapters to return (default 20, max 50)
#[arg(long, short = 'l', default_value_t = DEFAULT_LIMIT)]
limit: u8,
/// Offset for pagination
#[arg(long, short = 'o', default_value_t = DEFAULT_OFFSET)]
offset: u32,
},
/// List saved audiobooks
List {
/// Number of audiobooks to return (default 20, max 50)
#[arg(long, short = 'l', default_value_t = DEFAULT_LIMIT)]
limit: u8,
/// Offset for pagination
#[arg(long, short = 'o', default_value_t = DEFAULT_OFFSET)]
offset: u32,
},
/// Save audiobooks to library
Save {
/// Audiobook IDs to save
#[arg(required = true)]
ids: Vec<String>,
},
/// Remove audiobooks from library
Remove {
/// Audiobook IDs to remove
#[arg(required = true)]
ids: Vec<String>,
},
/// Check if audiobooks are in library
Check {
/// Audiobook IDs to check
#[arg(required = true)]
ids: Vec<String>,
},
}
#[derive(Subcommand)]
pub enum ChapterCommand {
/// Get chapter details
Get {
/// Chapter ID or URL
id: String,
},
}
#[derive(Subcommand)]
pub enum AlbumCommand {
/// List saved albums
List {
/// Number of albums to return (default 20, max 50)
#[arg(long, short = 'l', default_value_t = DEFAULT_LIMIT)]
limit: u8,
/// Offset for pagination
#[arg(long, short = 'o', default_value_t = DEFAULT_OFFSET)]
offset: u32,
},
/// Get album tracks
Tracks {
/// Album ID or URL
id: String,
/// Number of tracks to return (default 20, max 50)
#[arg(long, short = 'l', default_value_t = DEFAULT_LIMIT)]
limit: u8,
/// Offset for pagination
#[arg(long, short = 'o', default_value_t = DEFAULT_OFFSET)]
offset: u32,
},
/// Save albums to library
Save {
/// Album IDs to save
#[arg(required = true)]
ids: Vec<String>,
},
/// Remove albums from library
Remove {
/// Album IDs to remove
#[arg(required = true)]
ids: Vec<String>,
},
/// Check if albums are in library
Check {
/// Album IDs to check
#[arg(required = true)]
ids: Vec<String>,
},
/// Browse new album releases
NewReleases {
/// Number of albums to return (default 20, max 50)
#[arg(long, short = 'l', default_value_t = DEFAULT_LIMIT)]
limit: u8,
/// Offset for pagination
#[arg(long, short = 'o', default_value_t = DEFAULT_OFFSET)]
offset: u32,
},
}