Add _post wrapper, copy from pytrakt
pytrakt is slow accepting pull requests,
so implement it here meanwhile.
import trakt.movies
import trakt.sync
import trakt.users
+from trakt import post
from trakt.errors import ForbiddenException, OAuthException
from trakt.movies import Movie
from trakt.sync import Scrobbler
@@ -61,6 +62,19 @@ def stop(self, progress: float):
self.scrobbler.progress = progress
return self.scrobbler.pause()
+ # Copied method, until upstream is merged
+ # https://github.com/moogar0880/PyTrakt/pull/196
+ @post
+ def _post(self, uri):
+ payload = dict(
+ progress=self.scrobbler.progress,
+ app_version=self.scrobbler.version,
+ date=self.scrobbler.date
+ )
+ payload.update(self.scrobbler.media.to_json_singular())
+ response = yield uri, payload
+ yield response
+
class TraktRatingCollection(dict):
def __init__(self, trakt: TraktApi):
