-
Notifications
You must be signed in to change notification settings - Fork 0
/
Series - Copy.cs
263 lines (228 loc) · 7.58 KB
/
Series - Copy.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
using Newtonsoft.Json;
using System;
using System.Security.Cryptography.X509Certificates;
namespace Series
{
public class Series
{
public int id;
public string title;
public AlternateTitle alternateTitle;
public Image image;
public SeasonStatistic seasonStatistic;
public Season season;
public Rating rating;
public Statistics statistics;
public AddOptions addOptions;
public Root root;
public Series()
{
}
public static Series FromJson(string json)
{
try
{
return JsonConvert.DeserializeObject<Series>(json);
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred while deserializing JSON: {ex.Message}");
return null;
}
}
}
public class AlternateTitle
{
public string Title { get; set; }
public int SeasonNumber { get; set; }
public int SceneSeasonNumber { get; set; }
public string SceneOrigin { get; set; }
public string Comment { get; set; }
public static AlternateTitle FromJson(string json)
{
try
{
return JsonConvert.DeserializeObject<AlternateTitle>(json);
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred while deserializing JSON: {ex.Message}");
return null;
}
}
}
public class Image
{
public string CoverType { get; set; }
public string Url { get; set; }
public string RemoteUrl { get; set; }
public static Image FromJson(string json)
{
try
{
return JsonConvert.DeserializeObject<Image>(json);
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred while deserializing JSON: {ex.Message}");
return null;
}
}
}
public class SeasonStatistic
{
public DateTime NextAiring { get; set; }
public DateTime PreviousAiring { get; set; }
public int EpisodeFileCount { get; set; }
public int EpisodeCount { get; set; }
public int TotalEpisodeCount { get; set; }
public int SizeOnDisk { get; set; }
public List<string> ReleaseGroups { get; set; }
public static SeasonStatistic FromJson(string json)
{
try
{
return JsonConvert.DeserializeObject<SeasonStatistic>(json);
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred while deserializing JSON: {ex.Message}");
return null;
}
}
}
public class Season
{
public int SeasonNumber { get; set; }
public bool Monitored { get; set; }
public SeasonStatistic Statistics { get; set; }
public List<Image> Images { get; set; }
public static Season FromJson(string json)
{
try
{
return JsonConvert.DeserializeObject<Season>(json);
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred while deserializing JSON: {ex.Message}");
return null;
}
}
}
public class Rating
{
public int Votes { get; set; }
public int Value { get; set; }
public static Rating FromJson(string json)
{
try
{
return JsonConvert.DeserializeObject<Rating>(json);
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred while deserializing JSON: {ex.Message}");
return null;
}
}
}
public class Statistics
{
public int SeasonCount { get; set; }
public int EpisodeFileCount { get; set; }
public int EpisodeCount { get; set; }
public int TotalEpisodeCount { get; set; }
public int SizeOnDisk { get; set; }
public List<string> ReleaseGroups { get; set; }
public static Statistics FromJson(string json)
{
try
{
return JsonConvert.DeserializeObject<Statistics>(json);
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred while deserializing JSON: {ex.Message}");
return null;
}
}
}
public class AddOptions
{
public bool IgnoreEpisodesWithFiles { get; set; }
public bool IgnoreEpisodesWithoutFiles { get; set; }
public string Monitor { get; set; }
public bool SearchForMissingEpisodes { get; set; }
public bool SearchForCutoffUnmetEpisodes { get; set; }
public static AddOptions FromJson(string json)
{
try
{
return JsonConvert.DeserializeObject<AddOptions>(json);
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred while deserializing JSON: {ex.Message}");
return null;
}
}
}
public class Root
{
public int Id { get; set; }
public string Title { get; set; }
public List<AlternateTitle> AlternateTitles { get; set; }
public string SortTitle { get; set; }
public string Status { get; set; }
public string ProfileName { get; set; }
public string Overview { get; set; }
public DateTime NextAiring { get; set; }
public DateTime PreviousAiring { get; set; }
public string Network { get; set; }
public string AirTime { get; set; }
public List<Image> Images { get; set; }
public string OriginalLanguage { get; set; }
public string RemotePoster { get; set; }
public List<Season> Seasons { get; set; }
public int Year { get; set; }
public string Path { get; set; }
public int QualityProfileId { get; set; }
public bool SeasonFolder { get; set; }
public bool Monitored { get; set; }
public string MonitorNewItems { get; set; }
public bool UseSceneNumbering { get; set; }
public int Runtime { get; set; }
public int TvdbId { get; set; }
public int TvRageId { get; set; }
public int TvMazeId { get; set; }
public DateTime FirstAired { get; set; }
public DateTime LastAired { get; set; }
public string SeriesType { get; set; }
public string CleanTitle { get; set; }
public string ImdbId { get; set; }
public string TitleSlug { get; set; }
public string RootFolderPath { get; set; }
public string Folder { get; set; }
public string Certification { get; set; }
public List<string> Genres { get; set; }
public List<int> Tags { get; set; }
public DateTime Added { get; set; }
public AddOptions AddOptions { get; set; }
public Rating Ratings { get; set; }
public Statistics Statistics { get; set; }
public bool EpisodesChanged { get; set; }
public static Root FromJson(string json)
{
try
{
return JsonConvert.DeserializeObject<Root>(json);
}
catch (Exception ex)
{
Console.WriteLine($"An error occurred while deserializing JSON: {ex.Message}");
return null;
}
}
}
}