-
Notifications
You must be signed in to change notification settings - Fork 0
/
Movie.cs
268 lines (189 loc) · 5.95 KB
/
Movie.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
using Newtonsoft.Json;
/// <summary>
///
/// This is the class that will be used to create a movie object
/// by Deserializing the json response from the radarr api
/// and sending that request to the radarr api to be added.
///
/// Advised to not change any thing inside this file.
/// </summary>
public partial class Movie
{
[JsonProperty("addOptions")]
public AddOptions addOptions { get; set; }
[JsonProperty("added")]
public string added { get; set; }
[JsonProperty("alternateTitles")]
public AlternateTitle[] alternateTitles { get; set; }
[JsonProperty("certification")]
public string certification { get; set; }
[JsonProperty("cleanTitle")]
public string cleanTitle { get; set; }
[JsonProperty("collection")]
public Collection collection { get; set; }
[JsonProperty("folder")]
public string folder { get; set; }
[JsonProperty("folderName")]
public string folderName { get; set; }
[JsonProperty("genres")]
public string[] genres { get; set; }
[JsonProperty("hasFile")]
public bool hasFile { get; set; }
[JsonProperty("id")]
public int id { get; set; }
[JsonProperty("images")]
public Image[] images { get; set; }
[JsonProperty("imdbId")]
public string imdbId { get; set; }
[JsonProperty("inCinemas")]
public string inCinemas { get; set; }
[JsonProperty("isAvailable")]
public bool isAvailable { get; set; }
[JsonProperty("minimumAvailability")]
public string minimumAvailability { get; set; }
[JsonProperty("monitored")]
public bool monitored { get; set; }
[JsonProperty("originalLanguage")]
public OriginalLanguage originalLanguage { get; set; }
[JsonProperty("originalTitle")]
public string originalTitle { get; set; }
[JsonProperty("overview")]
public string overview { get; set; }
[JsonProperty("popularity")]
public decimal popularity { 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("secondaryYearSourceId")]
public int secondaryYearSourceId { get; set; }
[JsonProperty("sortTitle")]
public string sortTitle { get; set; }
[JsonProperty("studio")]
public string studio { get; set; }
[JsonProperty("tags")]
public int[] tags { get; set; }
[JsonProperty("title")]
public string title { get; set; }
[JsonProperty("titleSlug")]
public string titleSlug { get; set; }
[JsonProperty("tmdbId")]
public int tmdbId { get; set; }
[JsonProperty("website")]
public string website { get; set; }
[JsonProperty("year")]
public int year { get; set; }
[JsonProperty("youTubeTrailerId")]
public string youTubeTrailerId { get; set; }
//Sets the add options for the movie (needed for adding a movie)
public void SetAddOptions(bool searchForMovie, string monitor)
{
bool _searchForMovie;
string _monitor = "";
bool _searchForCutoffUnmetEpisodes;
if (searchForMovie == null)
{
_searchForMovie = true;
}
else
{
_searchForMovie = searchForMovie;
}
if (monitor == "")
{
_monitor = "movieOnly";
}
else
{
_monitor = monitor;
}
monitored = true;
AddOptions _addOptions = new AddOptions();
_addOptions.SetAddOptions(_searchForMovie, _monitor);
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("searchForMovie")]
public bool searchForMovie{ get; set; }
public void SetAddOptions(bool _searchForMovie, string _monitor)
{
searchForMovie = _searchForMovie;
monitor = _monitor;
}
}
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 Collection
{
[JsonProperty("added")]
public string added { get; set; }
[JsonProperty("id")]
public int id { get; set; }
[JsonProperty("images")]
public Image[] images { get; set; }
[JsonProperty("minimumAvailability")]
public string minimumAvailability { get; set; }
[JsonProperty("monitored")]
public bool monitored { get; set; }
[JsonProperty("qualityProfileId")]
public int qualityProfileId { get; set; }
[JsonProperty("tags")]
public int[] tags { get; set; }
[JsonProperty("title")]
public string title { get; set; }
[JsonProperty("tmdbId")]
public int tmdbId { get; set; }
}
public partial class AlternateTitle
{
[JsonProperty("sourceType")]
public string sourceType { get; set; }
[JsonProperty("movieMetadataId")]
public int movieMetadataId { get; set; }
[JsonProperty("title")]
public string title { get; set; }
}