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
use clap::Subcommand;
use std::path::PathBuf;
#[derive(clap::Args)]
pub struct AddArgs {
/// Clip ID(s) to add
pub clip_ids: Vec<String>,
/// Playlist ID to add clips to
#[arg(long = "to", value_name = "PLAYLIST_ID")]
pub playlist_id: String,
}
#[derive(clap::Args)]
pub struct PlaylistArgs {
#[command(subcommand)]
pub command: PlaylistCommand,
}
#[derive(Subcommand)]
pub enum PlaylistCommand {
/// List your playlists
List(PlaylistListArgs),
/// Show playlist details
Info(PlaylistInfoArgs),
/// Create a playlist
Create(PlaylistCreateArgs),
/// Update playlist metadata
Set(PlaylistSetArgs),
/// Add clips to a playlist
Add(PlaylistTracksArgs),
/// Remove clips from a playlist
Remove(PlaylistTracksArgs),
/// Toggle playlist public/private
Publish(PlaylistPublishArgs),
/// Move a clip to another playlist index
Reorder(PlaylistReorderArgs),
/// Restore a trashed playlist
Restore(PlaylistRestoreArgs),
/// Save a playlist to your library
Save(PlaylistSaveArgs),
/// Remove a saved playlist from your library
Unsave(PlaylistSaveArgs),
/// Like a playlist, or clear the like with --clear
Like(PlaylistReactionArgs),
/// Dislike a playlist, or clear the dislike with --clear
Dislike(PlaylistReactionArgs),
/// Delete/trash a playlist
Delete(PlaylistDeleteArgs),
}
#[derive(clap::Args)]
pub struct PlaylistListArgs {
/// Playlist page number
#[arg(long, default_value_t = 1)]
pub page: u32,
}
#[derive(clap::Args)]
pub struct PlaylistInfoArgs {
/// Playlist ID to inspect
pub id: String,
}
#[derive(clap::Args)]
pub struct PlaylistCreateArgs {
/// Playlist name
#[arg(long)]
pub name: String,
/// Playlist description
#[arg(long)]
pub description: Option<String>,
/// Playlist cover image URL
#[arg(long, conflicts_with = "image_file")]
pub image_url: Option<String>,
/// Local image file to upload and use as playlist cover
#[arg(long)]
pub image_file: Option<PathBuf>,
}
#[derive(clap::Args)]
pub struct PlaylistSetArgs {
/// Playlist ID to update
pub id: String,
/// New playlist name
#[arg(long)]
pub name: Option<String>,
/// New playlist description
#[arg(long)]
pub description: Option<String>,
/// New playlist cover image URL
#[arg(long, conflicts_with = "image_file")]
pub image_url: Option<String>,
/// Local image file to upload and use as playlist cover
#[arg(long)]
pub image_file: Option<PathBuf>,
}
#[derive(clap::Args)]
pub struct PlaylistTracksArgs {
/// Playlist ID to update
pub id: String,
/// Clip ID(s)
pub clip_ids: Vec<String>,
}
#[derive(clap::Args)]
pub struct PlaylistPublishArgs {
/// Playlist ID to update
pub id: String,
/// Make private instead of public
#[arg(long)]
pub private: bool,
}
#[derive(clap::Args)]
pub struct PlaylistReorderArgs {
/// Playlist ID to update
pub id: String,
/// Clip ID to move
#[arg(long)]
pub clip_id: String,
/// Destination zero-based index
#[arg(long)]
pub index: u32,
}
#[derive(clap::Args)]
pub struct PlaylistRestoreArgs {
/// Playlist ID to restore
pub id: String,
}
#[derive(clap::Args)]
pub struct PlaylistSaveArgs {
/// Playlist ID to save or unsave
pub id: String,
}
#[derive(clap::Args)]
pub struct PlaylistReactionArgs {
/// Playlist ID to update
pub id: String,
/// Clear this reaction instead of setting it
#[arg(long)]
pub clear: bool,
}
#[derive(clap::Args)]
pub struct PlaylistDeleteArgs {
/// Playlist ID to delete/trash
pub id: String,
/// Skip confirmation
#[arg(short = 'y', long)]
pub yes: bool,
}