MasterPuppeteer

Updates API url to avoid redirect.

...@@ -27,27 +27,27 @@ import tv.puppetmaster.data.i.* ...@@ -27,27 +27,27 @@ import tv.puppetmaster.data.i.*
27 import tv.puppetmaster.data.i.Puppet.PuppetIterator 27 import tv.puppetmaster.data.i.Puppet.PuppetIterator
28 import tv.puppetmaster.data.i.SourcesPuppet.SourceDescription 28 import tv.puppetmaster.data.i.SourcesPuppet.SourceDescription
29 29
30 -public class ComicVinePuppet implements InstallablePuppet { 30 +class ComicVinePuppet implements InstallablePuppet {
31 31
32 static final int VERSION_CODE = 5 32 static final int VERSION_CODE = 5
33 33
34 - def ParentPuppet mParent 34 + ParentPuppet mParent
35 - def String mBaseUrl 35 + String mBaseUrl
36 - def String mName 36 + String mName
37 - def String mDescription 37 + String mDescription
38 - def String mUrl 38 + String mUrl
39 - def String mImageUrl 39 + String mImageUrl
40 - def String mBackgroundImageUrl 40 + String mBackgroundImageUrl
41 - def boolean mIsTopLevel 41 + boolean mIsTopLevel
42 42
43 - public ComicVinePuppet() { 43 + ComicVinePuppet() {
44 this( 44 this(
45 null, 45 null,
46 - "http://api.comicvine.com", 46 + "https://comicvine.gamespot.com/api",
47 "Comic Vine", 47 "Comic Vine",
48 "Comic Vine is the world's largest comic book website. Watch hundreds of original videos and interviews with comic creators and artists.", 48 "Comic Vine is the world's largest comic book website. Watch hundreds of original videos and interviews with comic creators and artists.",
49 "/video_types/?api_key=c64ac7ddc90513cc15539f1d606e8670b1ef0ae4&format=json", 49 "/video_types/?api_key=c64ac7ddc90513cc15539f1d606e8670b1ef0ae4&format=json",
50 - "https://raw.githubusercontent.com/WhiskeyMedia/xbmc/master/plugin.video.comicvine/icon.png", 50 + "https://pbs.twimg.com/profile_images/838844221880578048/JqUAMeZr_400x400.jpg",
51 "http://static.comicvine.com/uploads/original/8/85249/3158213-project", 51 "http://static.comicvine.com/uploads/original/8/85249/3158213-project",
52 true 52 true
53 ) 53 )
...@@ -173,45 +173,45 @@ public class ComicVinePuppet implements InstallablePuppet { ...@@ -173,45 +173,45 @@ public class ComicVinePuppet implements InstallablePuppet {
173 mUrl = url 173 mUrl = url
174 } 174 }
175 175
176 - def static class ComicVineSearchesPuppet extends ComicVinePuppet implements SearchesPuppet { 176 + static class ComicVineSearchesPuppet extends ComicVinePuppet implements SearchesPuppet {
177 177
178 - def static final String SEARCH_URL = "/search/?api_key=c64ac7ddc90513cc15539f1d606e8670b1ef0ae4&format=json&resources=video&query=" 178 + static final String SEARCH_URL = "/search/?api_key=c64ac7ddc90513cc15539f1d606e8670b1ef0ae4&format=json&resources=video&query="
179 179
180 - public ComicVineSearchesPuppet(ParentPuppet parent) { 180 + ComicVineSearchesPuppet(ParentPuppet parent) {
181 super( 181 super(
182 parent, 182 parent,
183 - "http://api.comicvine.com", 183 + "https://comicvine.gamespot.com/api",
184 "Search", 184 "Search",
185 "Search Comic Vine", 185 "Search Comic Vine",
186 SEARCH_URL, 186 SEARCH_URL,
187 - "https://raw.githubusercontent.com/WhiskeyMedia/xbmc/master/plugin.video.comicvine/icon.png", 187 + "https://pbs.twimg.com/profile_images/838844221880578048/JqUAMeZr_400x400.jpg",
188 "http://static.comicvine.com/uploads/original/8/85249/3158213-project", 188 "http://static.comicvine.com/uploads/original/8/85249/3158213-project",
189 false 189 false
190 ) 190 )
191 } 191 }
192 192
193 @Override 193 @Override
194 - public void setSearchQuery(String searchQuery) { 194 + void setSearchQuery(String searchQuery) {
195 setUrl(SEARCH_URL + searchQuery.replace(" ", "%20")) 195 setUrl(SEARCH_URL + searchQuery.replace(" ", "%20"))
196 } 196 }
197 } 197 }
198 198
199 - def class ComicVineIterator extends PuppetIterator { 199 + class ComicVineIterator extends PuppetIterator {
200 200
201 - def ParentPuppet mParent 201 + ParentPuppet mParent
202 - def String mBaseUrl 202 + String mBaseUrl
203 - def String mUrl 203 + String mUrl
204 - def ArrayList<Puppet> mPuppets 204 + ArrayList<Puppet> mPuppets
205 205
206 - def int numSources = 0 206 + int numSources = 0
207 207
208 - def int currentCategoryIteration = 0 208 + int currentCategoryIteration = 0
209 - def int currentSourcesIteration = 0 209 + int currentSourcesIteration = 0
210 210
211 - transient def JSONArray categoryItems = new JSONArray() 211 + transient JSONArray categoryItems = new JSONArray()
212 - transient def JSONArray sourcesItems = new JSONArray() 212 + transient JSONArray sourcesItems = new JSONArray()
213 213
214 - public ComicVineIterator(ParentPuppet parent, String baseUrl, String url) { 214 + ComicVineIterator(ParentPuppet parent, String baseUrl, String url) {
215 mParent = parent 215 mParent = parent
216 mBaseUrl = baseUrl 216 mBaseUrl = baseUrl
217 mUrl = url 217 mUrl = url
...@@ -225,11 +225,11 @@ public class ComicVinePuppet implements InstallablePuppet { ...@@ -225,11 +225,11 @@ public class ComicVinePuppet implements InstallablePuppet {
225 if(mParent.isTopLevel()) { 225 if(mParent.isTopLevel()) {
226 mPuppets.add(new ComicVinePuppet( 226 mPuppets.add(new ComicVinePuppet(
227 null, 227 null,
228 - "http://api.comicvine.com", 228 + "https://comicvine.gamespot.com/api",
229 "Latest", 229 "Latest",
230 "Latest videos from Comic Vine", 230 "Latest videos from Comic Vine",
231 "/videos/?api_key=c64ac7ddc90513cc15539f1d606e8670b1ef0ae4&sort=-publish_date&format=json", 231 "/videos/?api_key=c64ac7ddc90513cc15539f1d606e8670b1ef0ae4&sort=-publish_date&format=json",
232 - "https://raw.githubusercontent.com/WhiskeyMedia/xbmc/master/plugin.video.comicvine/icon.png", 232 + "https://pbs.twimg.com/profile_images/838844221880578048/JqUAMeZr_400x400.jpg",
233 "http://static.comicvine.com/uploads/original/8/85249/3158213-project", 233 "http://static.comicvine.com/uploads/original/8/85249/3158213-project",
234 false 234 false
235 )) 235 ))
...@@ -262,7 +262,7 @@ public class ComicVinePuppet implements InstallablePuppet { ...@@ -262,7 +262,7 @@ public class ComicVinePuppet implements InstallablePuppet {
262 item.get("name").toString(), 262 item.get("name").toString(),
263 null, 263 null,
264 "/videos/?api_key=c64ac7ddc90513cc15539f1d606e8670b1ef0ae4&format=json&video_type=" + item.get("id").toString(), 264 "/videos/?api_key=c64ac7ddc90513cc15539f1d606e8670b1ef0ae4&format=json&video_type=" + item.get("id").toString(),
265 - "https://raw.githubusercontent.com/WhiskeyMedia/xbmc/master/plugin.video.comicvine/icon.png", 265 + "https://pbs.twimg.com/profile_images/838844221880578048/JqUAMeZr_400x400.jpg",
266 "http://static.comicvine.com/uploads/original/8/85249/3158213-project", 266 "http://static.comicvine.com/uploads/original/8/85249/3158213-project",
267 false 267 false
268 )) 268 ))
...@@ -291,19 +291,19 @@ public class ComicVinePuppet implements InstallablePuppet { ...@@ -291,19 +291,19 @@ public class ComicVinePuppet implements InstallablePuppet {
291 } 291 }
292 } 292 }
293 293
294 - def static class ComicVineSourcesPuppet implements SourcesPuppet { 294 + static class ComicVineSourcesPuppet implements SourcesPuppet {
295 295
296 - def ParentPuppet mParent 296 + ParentPuppet mParent
297 - def String mName 297 + String mName
298 - def String mDescription 298 + String mDescription
299 - def String mHighQualityVideoUrl 299 + String mHighQualityVideoUrl
300 - def String mLowQualityVideoUrl 300 + String mLowQualityVideoUrl
301 - def String mPublicationDate 301 + String mPublicationDate
302 - def long mDuration 302 + long mDuration
303 - def String mImageUrl 303 + String mImageUrl
304 - def String mBackgroundImageUrl 304 + String mBackgroundImageUrl
305 305
306 - public ComicVineSourcesPuppet(ParentPuppet parent, String name, String description, String highUrl, String lowUrl, String publishDate, String lengthSeconds, String imageUrl, String backgroundImageUrl) { 306 + ComicVineSourcesPuppet(ParentPuppet parent, String name, String description, String highUrl, String lowUrl, String publishDate, String lengthSeconds, String imageUrl, String backgroundImageUrl) {
307 mParent = parent 307 mParent = parent
308 mName = name 308 mName = name
309 mDescription = description 309 mDescription = description
...@@ -386,23 +386,23 @@ public class ComicVinePuppet implements InstallablePuppet { ...@@ -386,23 +386,23 @@ public class ComicVinePuppet implements InstallablePuppet {
386 } 386 }
387 387
388 @Override 388 @Override
389 - public PuppetIterator getRelated() { 389 + PuppetIterator getRelated() {
390 mParent.getChildren() 390 mParent.getChildren()
391 } 391 }
392 392
393 @Override 393 @Override
394 - public String toString() { 394 + String toString() {
395 return mParent == null ? getName() : mParent.toString() + " < " + getName() 395 return mParent == null ? getName() : mParent.toString() + " < " + getName()
396 } 396 }
397 397
398 - def class ComicVineSourceIterator implements SourcesPuppet.SourceIterator { 398 + class ComicVineSourceIterator implements SourcesPuppet.SourceIterator {
399 399
400 - def String mHighQualityVideoUrl 400 + String mHighQualityVideoUrl
401 - def String mLowQualityVideoUrl 401 + String mLowQualityVideoUrl
402 - def List<SourceDescription> mSources 402 + List<SourceDescription> mSources
403 - def int currentIndex = 0 403 + int currentIndex = 0
404 404
405 - public ComicVineSourceIterator(String highQualityVideoUrl, lowQualityVideoUrl) { 405 + ComicVineSourceIterator(String highQualityVideoUrl, lowQualityVideoUrl) {
406 mHighQualityVideoUrl = highQualityVideoUrl 406 mHighQualityVideoUrl = highQualityVideoUrl
407 mLowQualityVideoUrl = lowQualityVideoUrl 407 mLowQualityVideoUrl = lowQualityVideoUrl
408 } 408 }
......