Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to new TVDB API #144

Open
eprenamer opened this issue Apr 10, 2017 · 8 comments
Open

upgrade to new TVDB API #144

eprenamer opened this issue Apr 10, 2017 · 8 comments

Comments

@eprenamer
Copy link
Member

TheTVDB implemented a new, JSON-based API a while ago. They are really discouraging people from using the old API, and plan to shut it down within six months.

Note that one of the very specific test-cases TVRenamer uses, "Steven Seagal: Lawman", no longer works with the old API. The show is not found with the query we create, nor with any reasonable query we could create.

Unlike the other issues I've opened :) this is NOT something I've done already. I'd be very happy to see someone else get this done!

@vipuldelwadia
Copy link
Member

I can't promise anything (as you can guess, I've had no time to commit to this project lately) but I'll try to have a look sometime in the next week or so.

@eprenamer
Copy link
Member Author

The old API is not working right now. Maybe they'll fix it, maybe they won't. I think we definitely need to upgrade if we want the application to be reliable going forward.

@vipuldelwadia
Copy link
Member

I started work on the swagger API over the weekend, using swagger-codegen, however I didn't get very far - got bogged down on issues talking to the API. I'll have another go today using gson and a regular http client

@daveharris
Copy link
Member

daveharris commented May 22, 2017

@vipuldelwadia As luck would have it I have been working on a tiny Java application at work (after many many many years) and I got a really long way with using:

I was posting well-formed JSON to an API endpoint and parsing the data back into JSON. I did look into using Gson but it's very much built around the idea of binding objects to JSON which I didn't need. I guess we could use it here. I also investigated jackson-jr but found that org.json was so much simpler for what I needed.

Definitely take a look at okhttp, I was very impressed but how easy it was. Steer clear from Apache commons HTTP!

@vipuldelwadia
Copy link
Member

vipuldelwadia commented May 23, 2017

Yep I was planning to use okhttp. I had a play last night, got a couple of the calls implemented already - looks pretty straight forward.

Square have a JSON library called Moshi which looks like it could work for our purpose so I'll use that to parse the JSON response - I'd much rather create POJOs and use an object-binding library like Gson or Moshi than create/parse the JSON by hand.

@eprenamer
Copy link
Member Author

I was getting back to this. Interesting note: last night, the Swagger API stopped working temporarily, while the old API actually did still work. So it might be worthwhile to release a version that could fall back on the old API in the case of failure.

@eprenamer
Copy link
Member Author

@vipuldelwadia @daveharris

Hey guys, I'm kind of using this issue as a way to write a note. :-)

My activity slowed down a lot after the 0.8 release. I'm getting back to it now, a bit.

I actually started to do a release, like an 0.8b4 thing, but I guess it turns out that doesn't really work as a "new version". To be a new version, it (seems that it) needs to be 0.9.

So, if I was going to call the release 0.9, I thought there were a few small things to get in. But I keep finding more "small" things to get in. :-)

Anyway, I just wanted to update you. I plan to get a 0.9 out pretty soon.

I haven't forgotten at all about the new API and the existing PR, and I've continued updating the tvdbswagger branch. That will be a 1.0b0 release.

I wanted to see if you wanted to weigh in on some other matters. If not, that's fine. I will tag you in other issues for specific questions. Again, I just wanted to write a note here and update you.

@vipuldelwadia
Copy link
Member

Hey @eprenamer thanks for the heads up! I've been keeping up with the changes you're making, all look good from my point of view so carry on 👍. I'll let you know if there is anything I am unsure on.

I can't remember if you've done a release before or not, either way if you need any help just shout out :).

Exciting to see a 1.0 soon! Thanks for all your work on this project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants