megawubs / trakt-api-wrapper

A Object Oriented PHP wrapper for the trakt api
34 stars 19 forks source link

Feature request: Extended info #9

Closed m-vdv closed 9 years ago

m-vdv commented 9 years ago

Hi @megawubs The Trakt API allow for extended info to be requested for some API calls: Could this be implemented?

More info: http://docs.trakt.apiary.io/#introduction/extended-info

EDIT: Just noticed it's already implemented. Example usage: $trakt->movies->extendWithImages()->trending()

EDIT2: Isn't working for $trakt->users->extendWithImages()->history()

Please explain this in the docs :)

Thanks

megawubs commented 9 years ago

I havn't had the time to put this into the docs, because I'm unsure if it's to stay this way. I also want to add pagination first before documenting the new features.

I'll investigate why $trakt->users->extendWithImages()->history(); isn't working.

megawubs commented 9 years ago

I'm getting all images when I do $history = $trakt->users->withImages()->history("megawubs"); (I just renamed the methods to withImages() andwithFull()`). Do you provide it a username?

m-vdv commented 9 years ago

@megawubs Thanks for all your help and work on this!

Found out why the history call with images isn't working: $history = $trakt->users->withImages()->history("megawubs")->toArray();

Without "->toArray();" it works fine, but with "->toArray();" at the end I don't get the images :( How to fix?

m-vdv commented 9 years ago

@megawubs Not sure if that's the issue.. Tried some more and sometimes I get the images, most of the times I don't. Using the exact same API call, strange..

megawubs commented 9 years ago

With the ->toArray() call?

m-vdv commented 9 years ago

With or without doesn't matter.

$history = $trakt->users->withImages()->history("megawubs");

@megawubs Does this wrapper have built in caching?

megawubs commented 9 years ago

No, it'll always fetch from trakt

m-vdv commented 9 years ago

@megawubs I'm trying to figure out what's causing this.. it must be a caching thing not related to your wrapper.

Which ever API call I make first for a specific user (with extended images / full / min) it get's cached inside my browser/network(?) somehow. And when I change the extended parameter that doesn't change the API call output.

It has nothing to do with your wrapper 100% sure.. because when I test directly through Advanced Rest Client (https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo) so directly communicating with trakt api it's the same behavior.

m-vdv commented 9 years ago

@megawubs I've posted the issue in the trakt.tv google+ community.. https://plus.google.com/u/0/communities/103111515647012208243/stream/286c9184-0268-4c2d-9f74-0844b6ffecd1