Skip to content

Commit

Permalink
Updated [examples/collection.py]
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzeman committed Feb 17, 2015
1 parent 82a23e3 commit 6e858f4
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions examples/collection.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from helpers import authenticate

from trakt import Trakt
from trakt.objects import Movie, Show
import logging
import os

Expand All @@ -23,13 +24,29 @@
token=authenticate()
)

# Fetch playback
playback = Trakt['sync'].playback(exceptions=True)

for key, item in playback.items():
print item

if type(item) is Movie:
print '\tprogress: %r' % item.progress
print '\tpaused_at: %r' % item.paused_at
elif type(item) is Show:
for (sk, ek), episode in item.episodes():
print '\t', episode

print '\t\tprogress: %r' % episode.progress
print '\t\tpaused_at: %r' % episode.paused_at

# Fetch movie library (watched, collection, ratings)
movies = {}

# Trakt['sync/watched'].movies(movies)
# Trakt['sync/collection'].movies(movies)
#
# Trakt['sync/ratings'].movies(movies)
Trakt['sync/watched'].movies(movies, exceptions=True)
Trakt['sync/collection'].movies(movies, exceptions=True)

Trakt['sync/ratings'].movies(movies, exceptions=True)

for key, movie in movies.items():
print movie
Expand Down

0 comments on commit 6e858f4

Please sign in to comment.