-
Notifications
You must be signed in to change notification settings - Fork 0
/
Series.cs
251 lines (181 loc) · 6.49 KB
/
Series.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
using Newtonsoft.Json;
namespace XilftenBot
{
/// <summary>
///
/// This is the class that will be used to create a series objects
/// by Deserializing the json response from the Sonarr api
/// and sending that request to the Sonarr api to be added.
///
/// Advised to not change any thing inside this file.
/// </summary>
public partial class Series
{
[JsonProperty("addOptions")]
public AddOptions addOptions { get; set; }
[JsonProperty("added")]
public string added { get; set; }
[JsonProperty("alternateTitles")]
public string[] alternateTitles { get; set; }
[JsonProperty("CleanTitle")]
public string CleanTitle { get; set; }
[JsonProperty("ended")]
public bool ended { get; set; }
[JsonProperty("firstAired")]
public string firstAired { get; set; }
[JsonProperty("folder")]
public string folder { get; set; }
[JsonProperty("genres")]
public string[] genres { get; set; }
[JsonProperty("images")]
public Image[] images { get; set; }
[JsonProperty("languageProfileId")]
public int languageProfileId { get; set; }
[JsonProperty("monitored")]
public bool monitored { get; set; }
[JsonProperty("network")]
public string network { get; set; }
[JsonProperty("originalLanguage")]
public OriginalLanguage originalLanguage { get; set; }
[JsonProperty("overview")]
public string overview { get; set; }
[JsonProperty("qualityProfileId")]
public int qualityProfileId { get; set; }
[JsonProperty("ratings")]
public Ratings ratings { get; set; }
[JsonProperty("remotePoster")]
public string remotePoster { get; set; }
[JsonProperty("rootFolderPath")]
public string rootFolderPath { get; set; }
[JsonProperty("runtime")]
public int runtime { get; set; }
[JsonProperty("seasonFolder")]
public bool seasonFolder { get; set; }
[JsonProperty("seasons")]
public Season[] seasons { get; set; }
[JsonProperty("seriesType")]
public string seriesType { get; set; }
[JsonProperty("sortTitle")]
public string sortTitle { get; set; }
[JsonProperty("statistic")]
public Statistics statistics { get; set; }
[JsonProperty("status")]
public string status { get; set; }
[JsonProperty("tags")]
public int[] tags { get; set; }
[JsonProperty("title")]
public string title { get; set; }
[JsonProperty("titleSlug")]
public string titleSlug { get; set; }
[JsonProperty("tvMazeId")]
public int tvMazeId { get; set; }
[JsonProperty("tvRageId")]
public int tvRageId { get; set; }
[JsonProperty("tvdbId")]
public int tvdbId { get; set; }
[JsonProperty("useSceneNumbering")]
public bool useSceneNumbering { get; set; }
[JsonProperty("year")]
public int year { get; set; }
//Sets the add options for the series (needed for adding a show)
public void SetAddOptions(bool searchForMissing, string monitor, bool searchForCutoffUnmetEpisodes)
{
bool _searchForMissing ;
string _monitor = "";
bool _searchForCutoffUnmetEpisodes ;
if (searchForMissing == null)
{
_searchForMissing = false;
}
else
{
_searchForMissing = searchForMissing;
}
if (monitor == "")
{
_monitor = "all";
}
else
{
_monitor = monitor;
}
if (searchForCutoffUnmetEpisodes == null)
{
_searchForCutoffUnmetEpisodes = false;
}
else
{
_searchForCutoffUnmetEpisodes = searchForCutoffUnmetEpisodes;
}
AddOptions _addOptions = new AddOptions();
_addOptions.SetAddOptions(_searchForMissing, _monitor, _searchForCutoffUnmetEpisodes);
addOptions=_addOptions;
}
}
/// <summary>
///
/// All of the following are needed to Deserialize the json response from the radarr api.
/// I would not recommend changing any of the following classes.
///
/// </summary>
public partial class AddOptions
{
[JsonProperty("monitor")]
public string monitor { get; set; }
[JsonProperty("searchForMissingEpisodes")]
public bool searchForMissingEpisodes { get; set; }
[JsonProperty("searchForCutoffUnmetEpisodes")]
public bool searchForCutoffUnmetEpisodes { get; set; }
public void SetAddOptions(bool searchForMissing, string _monitor, bool searchForCutoff)
{
searchForMissingEpisodes = searchForMissing;
monitor = _monitor;
searchForCutoffUnmetEpisodes = searchForCutoff;
}
}
public partial class Image
{
[JsonProperty("coverType")]
public string coverType { get; set; }
[JsonProperty("remoteUrl")]
public string remoteUrl { get; set; }
[JsonProperty("url")]
public string url { get; set; }
}
public partial class OriginalLanguage
{
[JsonProperty("id")]
public int id { get; set; }
[JsonProperty("name")]
public string name { get; set; }
}
public partial class Ratings
{
[JsonProperty("value")]
public int value { get; set; }
[JsonProperty("votes")]
public int votes { get; set; }
}
public partial class Season
{
[JsonProperty("monitored")]
public bool monitored { get; set; }
[JsonProperty("seasonNumber")]
public int seasonNumber { get; set; }
}
public partial class Statistics
{
[JsonProperty("episodeCount")]
public int episodeCount { get; set; }
[JsonProperty("episodeFileCount")]
public int episodeFileCount { get; set; }
[JsonProperty("percentOfEpisodes")]
public int percentOfEpisodes { get; set; }
[JsonProperty("seasonCount")]
public int seasonCount { get; set; }
[JsonProperty("sizeOnDisk")]
public int sizeOnDisk { get; set; }
[JsonProperty("totalEpisodeCount")]
public int totalEpisodeCount { get; set; }
}
}