@@ -148,3 +148,87 @@ impl Borrow<str> for Empty {
148
148
unreachable ! ( "Should never be used as a value" )
149
149
}
150
150
}
151
+
152
+ // --- Art Requests ---
153
+ #[ derive( Debug , Serialize , Deserialize , Clone , PartialEq , Eq ) ]
154
+ pub struct ArtGrid {
155
+ /// The background for the cover art
156
+ pub background : ArtGridBackground ,
157
+
158
+ /// The size of the cover art image
159
+ pub image_size : u64 ,
160
+
161
+ /// The dimension to use for this grid. A grid of dimension 3 has 3 images across and 3 images down, for a total of 9 images.
162
+ pub dimension : u64 ,
163
+
164
+ /// If cover art is missing for a given release_mbid, skip it and move on to the next one, if true is passed.
165
+ /// If false, the show-caa option will decide what happens.
166
+ #[ serde( rename = "skip-missing" ) ]
167
+ pub skip_missing : bool ,
168
+
169
+ /// If cover art is missing and skip-missing is false,
170
+ /// then show-caa will determine if a blank square is shown or if the Cover Art Archive missing image is shown.
171
+ #[ serde( rename = "show-caa" ) ]
172
+ pub show_caa : bool ,
173
+
174
+ /// The tiles parameter is a list of strings that determines the location where cover art images should be placed.
175
+ /// Each string is a comma separated list of image cells.
176
+ /// A grid of dimension 3 has 9 cells, from 0 in the upper left hand corner, 2 in the upper right hand corner,
177
+ /// 6 in the lower left corner and 8 in the lower right corner.
178
+ ///
179
+ /// ```plaintext
180
+ /// 0 1 2
181
+ /// 3 4 5
182
+ /// 6 7 8
183
+ /// ```
184
+ ///
185
+ /// Specifying only a single cell will have the image cover that cell exactly.
186
+ /// If more than one cell is specified, the image will cover the area defined by the bounding box of all the given cells.
187
+ /// These tiles only define bounding box areas – no clipping of images that may fall outside of these tiles will be performed.
188
+ ///
189
+ /// ## Exemple
190
+ /// For this exemple, the dimension is set to 3
191
+ /// ```
192
+ /// let tiles = vec![
193
+ /// "0, 1, 3, 4".to_string(), // The first image cover the slots 0, 1, 3, and 4
194
+ /// "2".to_string(),
195
+ /// "5".to_string(),
196
+ /// "6".to_string(),
197
+ /// "7".to_string(),
198
+ /// "8".to_string(),
199
+ /// ];
200
+ /// ```
201
+ ///
202
+ /// This will result in this arrangement:
203
+ ///
204
+ /// ```plaintext
205
+ /// 1 1 2
206
+ /// 1 1 3
207
+ /// 4 5 6
208
+ /// ```
209
+ pub tiles : Option < Vec < String > > ,
210
+
211
+ /// An ordered list of release_mbids. The images will be loaded and processed in the order that this list is in.
212
+ /// The cover art for the release_mbids will be placed on the tiles defined by the tiles parameter.
213
+ /// If release_group_mbids are supplied as well, ONLY cover arts for release_group_mbids will be processed.
214
+ pub release_mbids : Option < Vec < String > > ,
215
+
216
+ /// An ordered list of release_group_mbids. The images will be loaded and processed in the order that this list is in.
217
+ /// The cover art for the release_group_mbids will be placed on the tiles defined by the tiles parameter.
218
+ /// If release_mbids are supplied as well, ONLY cover arts for release_mbids will be processed.
219
+ pub release_group_mbids : Option < Vec < String > > ,
220
+
221
+ /// Size in pixels of each cover art in the composited image. Can be either 250 or 500
222
+ pub cover_art_size : Option < u64 > ,
223
+ }
224
+
225
+ /// The background for the cover art
226
+ #[ derive( Debug , Serialize , Deserialize , Clone , PartialEq , Eq ) ]
227
+ pub enum ArtGridBackground {
228
+ #[ serde( rename = "transparent" ) ]
229
+ Transparent ,
230
+ #[ serde( rename = "white" ) ]
231
+ White ,
232
+ #[ serde( rename = "black" ) ]
233
+ Black ,
234
+ }
0 commit comments