-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNfoDtos.cs
579 lines (549 loc) · 20.9 KB
/
NfoDtos.cs
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
using System;
using System.Xml.Serialization;
using System.Collections.Generic;
using NfoSharp;
namespace NfoSharp.NfoDtos
{
[XmlRoot(ElementName="movie")]
public class Movie {
[XmlElement(ElementName="title")]
public string Title { get; set; }
[XmlElement(ElementName="originaltitle")]
public string Originaltitle { get; set; }
[XmlElement(ElementName="sorttitle")]
public string Sorttitle { get; set; }
[XmlArray(ElementName="ratings")]
[XmlArrayItem(ElementName="rating")]
public List<Rating> Ratings { get; set; } = new List<Rating>();
[XmlElement(ElementName="userrating")]
public string Userrating { get; set; }
[XmlElement(ElementName="top250")]
public string Top250 { get; set; }
[XmlElement(ElementName="outline")]
public string Outline { get; set; }
[XmlElement(ElementName="plot")]
public string Plot { get; set; }
[XmlElement(ElementName="tagline")]
public string Tagline { get; set; }
[XmlElement(ElementName="runtime")]
public string Runtime { get; set; }
[XmlElement(ElementName="thumb")]
public List<Thumb> Thumbs { get; set; } = new List<Thumb>();
[XmlArray(ElementName="fanart")]
[XmlArrayItem(ElementName="thumb")]
public List<Thumb> Fanart { get; set; } = new List<Thumb>();
[XmlElement(ElementName="mpaa")]
public string Mpaa { get; set; }
[XmlElement(ElementName="playcount")]
public string Playcount { get; set; }
[XmlElement(ElementName="lastplayed")]
public string Lastplayed { get; set; }
[XmlElement(ElementName="id")]
public string Id { get; set; }
[XmlElement(ElementName="uniqueid")]
public List<Uniqueid> Uniqueids { get; set; } = new List<Uniqueid>();
[XmlElement(ElementName="genre")]
public List<string> Genres { get; set; } = new List<string>();
[XmlElement(ElementName="country")]
public List<string> Countries { get; set; } = new List<string>();
[XmlElement(ElementName="set")]
public Set Set { get; set; }
[XmlElement(ElementName="tag")]
public List<string> Tags { get; set; } = new List<string>();
[XmlElement(ElementName="credits")]
public List<string> Credits { get; set; } = new List<string>();
[XmlElement(ElementName="director")]
public List<string> Directors { get; set; } = new List<string>();
[XmlElement(ElementName="premiered")]
public string Premiered { get; set; }
[XmlElement(ElementName="year")]
public string Year { get; set; }
[XmlElement(ElementName="status")]
public string Status { get; set; }
[XmlElement(ElementName="code")]
public string Code { get; set; }
[XmlElement(ElementName="aired")]
public string Aired { get; set; }
[XmlElement(ElementName="studio")]
public List<string> Studios { get; set; } = new List<string>();
[XmlElement(ElementName="trailer")]
public string Trailer { get; set; }
[XmlElement(ElementName="fileinfo")]
public Fileinfo Fileinfo { get; set; }
[XmlElement(ElementName="actor")]
public List<Actor> Actors { get; set; } = new List<Actor>();
[XmlElement(ElementName="showlink")]
public string Showlink { get; set; }
[XmlElement(ElementName="resume")]
public Resume Resume { get; set; }
[XmlElement(ElementName="dateadded")]
public string Dateadded { get; set; }
public Movie() {}
public Movie(string title) {
Title = title;
if (NfoSharp.GeneratedNfos)
Uniqueid.Add(NfoDtos.Uniqueid.Generate());
}
}
[XmlRoot(ElementName="tvshow")]
public class Tvshow {
[XmlElement(ElementName="title")]
public string Title { get; set; }
[XmlElement(ElementName="originaltitle")]
public string Originaltitle { get; set; }
[XmlElement(ElementName="showtitle")]
public string Showtitle { get; set; }
[XmlElement(ElementName="sorttitle")]
public string Sorttitle { get; set; }
[XmlArray(ElementName="ratings")]
[XmlArrayItem(ElementName="rating")]
public List<Rating> Ratings { get; set; } = new List<Rating>();
[XmlElement(ElementName="userrating")]
public string Userrating { get; set; }
[XmlElement(ElementName="top250")]
public string Top250 { get; set; }
[XmlElement(ElementName="season")]
public string Season { get; set; }
[XmlElement(ElementName="episode")]
public string Episode { get; set; }
[XmlElement(ElementName="displayepisode")]
public string Displayepisode { get; set; }
[XmlElement(ElementName="displayseason")]
public string Displayseason { get; set; }
[XmlElement(ElementName="namedseason")]
public List<Namedseason> Namedseasons { get; set; } = new List<Namedseason>();
[XmlElement(ElementName="outline")]
public string Outline { get; set; }
[XmlElement(ElementName="plot")]
public string Plot { get; set; }
[XmlElement(ElementName="tagline")]
public string Tagline { get; set; }
[XmlElement(ElementName="runtime")]
public string Runtime { get; set; }
[XmlElement(ElementName="thumb")]
public List<Thumb> Thumbs { get; set; } = new List<Thumb>();
[XmlArray(ElementName="fanart")]
[XmlArrayItem(ElementName="thumb")]
public List<Thumb> Fanart { get; set; } = new List<Thumb>();
[XmlElement(ElementName="mpaa")]
public string Mpaa { get; set; }
[XmlElement(ElementName="playcount")]
public string Playcount { get; set; }
[XmlElement(ElementName="lastplayed")]
public string Lastplayed { get; set; }
[XmlElement(ElementName="episodeguide")]
public Episodeguide Episodeguide { get; set; }
[XmlElement(ElementName="id")]
public string Id { get; set; }
[XmlElement(ElementName="uniqueid")]
public List<Uniqueid> Uniqueids { get; set; } = new List<Uniqueid>();
[XmlElement(ElementName="genre")]
public List<string> Genres { get; set; } = new List<string>();
[XmlElement(ElementName="tag")]
public List<string> Tags { get; set; } = new List<string>();
[XmlElement(ElementName="premiered")]
public string Premiered { get; set; }
[XmlElement(ElementName="year")]
public string Year { get; set; }
[XmlElement(ElementName="status")]
public string Status { get; set; }
[XmlElement(ElementName="code")]
public string Code { get; set; }
[XmlElement(ElementName="aired")]
public string Aired { get; set; }
[XmlElement(ElementName="studio")]
public List<string> Studios { get; set; } = new List<string>();
[XmlElement(ElementName="trailer")]
public string Trailer { get; set; }
[XmlElement(ElementName="actor")]
public List<Actor> Actors { get; set; } = new List<Actor>();
[XmlElement(ElementName="resume")]
public Resume Resume { get; set; }
[XmlElement(ElementName="dateadded")]
public string Dateadded { get; set; }
public Tvshow() {}
public Tvshow(string title) {
Title = title;
if (NfoSharp.GeneratedNfos)
Uniqueid.Add(NfoDtos.Uniqueid.Generate());
}
}
[XmlRoot(ElementName="episodedetails")]
public class Episodedetails {
[XmlElement(ElementName="title")]
public string Title { get; set; }
[XmlElement(ElementName="originaltitle")]
public string Originaltitle { get; set; }
[XmlElement(ElementName="showtitle")]
public string Showtitle { get; set; }
[XmlArray(ElementName="ratings")]
[XmlArrayItem(ElementName="rating")]
public List<Rating> Ratings { get; set; } = new List<Rating>();
[XmlElement(ElementName="userrating")]
public string Userrating { get; set; }
[XmlElement(ElementName="top250")]
public string Top250 { get; set; }
[XmlElement(ElementName="season")]
public string Season { get; set; }
[XmlElement(ElementName="episode")]
public string Episode { get; set; }
[XmlElement(ElementName="displayepisode")]
public string Displayepisode { get; set; }
[XmlElement(ElementName="displayseason")]
public string Displayseason { get; set; }
[XmlElement(ElementName="outline")]
public string Outline { get; set; }
[XmlElement(ElementName="plot")]
public string Plot { get; set; }
[XmlElement(ElementName="tagline")]
public string Tagline { get; set; }
[XmlElement(ElementName="runtime")]
public string Runtime { get; set; }
[XmlElement(ElementName="thumb")]
public List<string> Thumbs { get; set; } = new List<string>();
[XmlElement(ElementName="mpaa")]
public string Mpaa { get; set; }
[XmlElement(ElementName="playcount")]
public string Playcount { get; set; }
[XmlElement(ElementName="lastplayed")]
public string Lastplayed { get; set; }
[XmlElement(ElementName="id")]
public string Id { get; set; }
[XmlElement(ElementName="uniqueid")]
public List<Uniqueid> Uniqueids { get; set; } = new List<Uniqueid>();
[XmlElement(ElementName="genre")]
public List<string> Genres { get; set; } = new List<string>();
[XmlElement(ElementName="credits")]
public List<string> Credits { get; set; } = new List<string>();
[XmlElement(ElementName="director")]
public List<string> Directors { get; set; } = new List<string>();
[XmlElement(ElementName="premiered")]
public string Premiered { get; set; }
[XmlElement(ElementName="year")]
public string Year { get; set; }
[XmlElement(ElementName="status")]
public string Status { get; set; }
[XmlElement(ElementName="code")]
public string Code { get; set; }
[XmlElement(ElementName="aired")]
public string Aired { get; set; }
[XmlElement(ElementName="studio")]
public List<string> Studios { get; set; } = new List<string>();
[XmlElement(ElementName="trailer")]
public string Trailer { get; set; }
[XmlElement(ElementName="episodebookmark")]
public Episodebookmark Episodebookmark { get; set; }
[XmlElement(ElementName="fileinfo")]
public Fileinfo Fileinfo { get; set; }
[XmlElement(ElementName="actor")]
public List<Actor> Actors { get; set; } = new List<Actor>();
[XmlElement(ElementName="resume")]
public Resume Resume { get; set; }
[XmlElement(ElementName="dateadded")]
public string Dateadded { get; set; }
public Episodedetails() {}
public Episodedetails(string title, string showTitle) {
Title = title;
Showtitle = showTitle;
if (NfoSharp.GeneratedNfos)
Uniqueid.Add(NfoDtos.Uniqueid.Generate());
}
}
[XmlRoot(ElementName="musicvideo")]
public class Musicvideo {
[XmlElement(ElementName="title")]
public string Title { get; set; }
[XmlElement(ElementName="userrating")]
public string Userrating { get; set; }
[XmlElement(ElementName="top250")]
public string Top250 { get; set; }
[XmlElement(ElementName="track")]
public string Track { get; set; }
[XmlElement(ElementName="album")]
public string Album { get; set; }
[XmlElement(ElementName="outline")]
public string Outline { get; set; }
[XmlElement(ElementName="plot")]
public string Plot { get; set; }
[XmlElement(ElementName="tagline")]
public string Tagline { get; set; }
[XmlElement(ElementName="runtime")]
public string Runtime { get; set; }
[XmlElement(ElementName="thumb")]
public List<Thumb> Thumbs { get; set; } = new List<Thumb>();
[XmlElement(ElementName="mpaa")]
public string Mpaa { get; set; }
[XmlElement(ElementName="playcount")]
public string Playcount { get; set; }
[XmlElement(ElementName="id")]
public string Id { get; set; }
[XmlElement(ElementName="genre")]
public List<string> Genres { get; set; } = new List<string>();
[XmlElement(ElementName="tag")]
public List<string> Tags { get; set; } = new List<string>();
[XmlElement(ElementName="director")]
public List<string> Directors { get; set; } = new List<string>();
[XmlElement(ElementName="year")]
public string Year { get; set; }
[XmlElement(ElementName="status")]
public string Status { get; set; }
[XmlElement(ElementName="code")]
public string Code { get; set; }
[XmlElement(ElementName="aired")]
public string Aired { get; set; }
[XmlElement(ElementName="studio")]
public List<string> Studios { get; set; } = new List<string>();
[XmlElement(ElementName="trailer")]
public string Trailer { get; set; }
[XmlElement(ElementName="fileinfo")]
public Fileinfo Fileinfo { get; set; }
[XmlElement(ElementName="artist")]
public List<string> Artists { get; set; } = new List<string>();
[XmlElement(ElementName="resume")]
public Resume Resume { get; set; }
[XmlElement(ElementName="dateadded")]
public string Dateadded { get; set; }
public Musicvideo() {}
public Musicvideo(string title) {
Title = title;
}
}
[XmlRoot(ElementName="artist")]
public class Artist {
[XmlElement(ElementName="name")]
public string Name { get; set; }
[XmlElement(ElementName="musicBrainzArtistID")]
public string MusicBrainzArtistID { get; set; }
[XmlElement(ElementName="sortname")]
public string Sortname { get; set; }
[XmlElement(ElementName="type")]
public string Type { get; set; }
[XmlElement(ElementName="gender")]
public string Gender { get; set; }
[XmlElement(ElementName="disambiguation")]
public string Disambiguation { get; set; }
[XmlElement(ElementName="genre")]
public List<string> Genres { get; set; } = new List<string>();
[XmlElement(ElementName="style")]
public List<string> Styles { get; set; } = new List<string>();
[XmlElement(ElementName="mood")]
public List<string> Moods { get; set; } = new List<string>();
[XmlElement(ElementName="yearsactive")]
public List<string> Yearsactive { get; set; } = new List<string>();
[XmlElement(ElementName="instruments")]
public List<string> Instruments { get; set; } = new List<string>();
[XmlElement(ElementName="born")]
public string Born { get; set; }
[XmlElement(ElementName="formed")]
public string Formed { get; set; }
[XmlElement(ElementName="biography")]
public string Biography { get; set; }
[XmlElement(ElementName="died")]
public string Died { get; set; }
[XmlElement(ElementName="disbanded")]
public string Disbanded { get; set; }
[XmlElement(ElementName="thumb")]
public List<Thumb> Thumbs { get; set; } = new List<Thumb>();
[XmlElement(ElementName="path")]
public string Path { get; set; }
[XmlArray(ElementName="fanart")]
[XmlArrayItem(ElementName="thumb")]
public List<Thumb> Fanart { get; set; } = new List<Thumb>();
[XmlElement(ElementName="album")]
public List<Album> Albums { get; set; } = new List<Album>();
}
[XmlRoot(ElementName="album")]
public class Album {
[XmlElement(ElementName="title")]
public string Title { get; set; }
[XmlElement(ElementName="year")]
public string Year { get; set; }
[XmlElement(ElementName="musicBrainzAlbumID")]
public string MusicBrainzAlbumID { get; set; }
[XmlElement(ElementName="musicbrainzreleasegroupid")]
public string Musicbrainzreleasegroupid { get; set; }
[XmlElement(ElementName="scrapedmbid")]
public string Scrapedmbid { get; set; }
[XmlElement(ElementName="artistdesc")]
public string Artistdesc { get; set; }
[XmlElement(ElementName="genre")]
public List<string> Genres { get; set; } = new List<string>();
[XmlElement(ElementName="style")]
public List<string> Styles { get; set; } = new List<string>();
[XmlElement(ElementName="mood")]
public List<string> Moods { get; set; } = new List<string>();
[XmlElement(ElementName="theme")]
public List<string> Themes { get; set; } = new List<string>();
[XmlElement(ElementName="compilation")]
public string Compilation { get; set; }
[XmlElement(ElementName="review")]
public string Review { get; set; }
[XmlElement(ElementName="type")]
public string Type { get; set; }
[XmlElement(ElementName="releasedate")]
public string Releasedate { get; set; }
[XmlElement(ElementName="label")]
public string Label { get; set; }
[XmlElement(ElementName="thumb")]
public List<Thumb> Thumbs { get; set; } = new List<Thumb>();
[XmlElement(ElementName="path")]
public string Path { get; set; }
[XmlElement(ElementName="rating")]
public Rating Rating { get; set; }
[XmlElement(ElementName="userrating")]
public Userrating Userrating { get; set; }
[XmlElement(ElementName="votes")]
public string Votes { get; set; }
[XmlElement(ElementName="albumArtistCredits")]
public List<AlbumArtistCredits> AlbumArtistCredits { get; set; } = new List<AlbumArtistCredits>();
[XmlElement(ElementName="releasetype")]
public string Releasetype { get; set; }
}
[XmlRoot(ElementName="rating")]
public class Rating {
[XmlElement(ElementName="value")]
public string Value { get; set; }
[XmlElement(ElementName="votes")]
public string Votes { get; set; }
[XmlAttribute(AttributeName="name")]
public string Name { get; set; }
[XmlAttribute(AttributeName="max")]
public string Max { get; set; }
[XmlAttribute(AttributeName="default")]
public bool Default { get; set; }
}
[XmlRoot(ElementName="thumb")]
public class Thumb {
[XmlAttribute(AttributeName="aspect")]
public string Aspect { get; set; }
[XmlAttribute(AttributeName="preview")]
public string Preview { get; set; }
[XmlAttribute(AttributeName="type")]
public string Type { get; set; }
[XmlAttribute(AttributeName="season")]
public string Season { get; set; }
[XmlText]
public string ThumbLocation { get; set; }
}
[XmlRoot(ElementName="uniqueid")]
public class Uniqueid {
[XmlAttribute(AttributeName="type")]
public string Type { get; set; }
[XmlAttribute(AttributeName="default")]
public bool Default { get; set; }
[XmlText]
public string Id {get; set; }
public static Uniqueid Generate(string type = null)=>
new Uniqueid(){
Id = Guid.NewGuid().ToString(),
Type = type ?? NfoSharp.UniqueidType,
Default = true
};
}
[XmlRoot(ElementName="set")]
public class Set {
[XmlElement(ElementName="name")]
public string Name { get; set; }
[XmlElement(ElementName="overview")]
public string Overview { get; set; }
}
[XmlRoot(ElementName="video")]
public class Video {
[XmlElement(ElementName="codec")]
public string Codec { get; set; }
[XmlElement(ElementName="aspect")]
public string Aspect { get; set; }
[XmlElement(ElementName="width")]
public string Width { get; set; }
[XmlElement(ElementName="height")]
public string Height { get; set; }
[XmlElement(ElementName="durationinseconds")]
public string Durationinseconds { get; set; }
[XmlElement(ElementName="stereomode")]
public string Stereomode { get; set; }
}
[XmlRoot(ElementName="audio")]
public class Audio {
[XmlElement(ElementName="codec")]
public string Codec { get; set; }
[XmlElement(ElementName="language")]
public string Language { get; set; }
[XmlElement(ElementName="channels")]
public string Channels { get; set; }
}
[XmlRoot(ElementName="subtitle")]
public class Subtitle {
[XmlElement(ElementName="language")]
public string Language { get; set; }
}
[XmlRoot(ElementName="streamdetails")]
public class Streamdetails {
[XmlElement(ElementName="video")]
public Video Video { get; set; }
[XmlElement(ElementName="audio")]
public List<Audio> Audio { get; set; } = new List<Audio>(); // To pluralize or not to pluralize, that is the question
[XmlElement(ElementName="subtitle")]
public List<Subtitle> Subtitles { get; set; } = new List<Subtitle>();
}
[XmlRoot(ElementName="fileinfo")]
public class Fileinfo {
[XmlElement(ElementName="streamdetails")]
public Streamdetails Streamdetails { get; set; }
}
[XmlRoot(ElementName="actor")]
public class Actor {
[XmlElement(ElementName="name")]
public string Name { get; set; }
[XmlElement(ElementName="role")]
public string Role { get; set; }
[XmlElement(ElementName="order")]
public string Order { get; set; }
[XmlElement(ElementName="thumb")]
public string Thumb { get; set; }
}
[XmlRoot(ElementName="resume")]
public class Resume {
[XmlElement(ElementName="position")]
public string Position { get; set; }
[XmlElement(ElementName="total")]
public string Total { get; set; }
}
[XmlRoot(ElementName="namedseason")]
public class Namedseason {
[XmlAttribute(AttributeName="number")]
public string Number { get; set; }
[XmlText]
public string Name { get; set; }
}
[XmlRoot(ElementName="url")]
public class Url {
[XmlAttribute(AttributeName="cache")]
public string Cache { get; set; }
[XmlText]
public string Address { get; set; }
}
[XmlRoot(ElementName="episodeguide")]
public class Episodeguide {
[XmlElement(ElementName="url")]
public Url Url { get; set; }
}
[XmlRoot(ElementName="episodebookmark")]
public class Episodebookmark {
[XmlElement(ElementName="position")]
public string Position { get; set; }
}
[XmlRoot(ElementName="userrating")]
public class Userrating {
[XmlAttribute(AttributeName="max")]
public string Max { get; set; }
[XmlText]
public string Rating { get; set; }
}
[XmlRoot(ElementName="albumArtistCredits")]
public class AlbumArtistCredits {
[XmlElement(ElementName="artist")]
public string Artist { get; set; }
[XmlElement(ElementName="musicBrainzArtistID")]
public string MusicBrainzArtistID { get; set; }
}
}