@@ -509,22 +509,39 @@ def show_collection(self):
509509 self ._show_collection .append (show )
510510 yield self ._show_collection
511511
512- @property
512+ def _build_watched_movies (self , data ):
513+ """Parse raw API response data into a list of :class:`Movie` objects.
514+
515+ :param data: List of raw movie dicts from the Trakt API
516+ :return: List of :class:`Movie` instances
517+ """
518+ watched_movies = []
519+ for movie in data :
520+ movie_data = movie .pop ('movie' )
521+ movie_data .update (movie )
522+ watched_movies .append (Movie (** movie_data ))
523+ return watched_movies
524+
513525 @get
526+ def get_watched_movies (self ):
527+ """Watched progress for all :class:`Movie` objects for this
528+ :class:`User`.
529+
530+ :return: List of :class:`Movie` instances
531+ """
532+ data = yield 'users/{user}/watched/movies' .format (
533+ user = slugify (self .username )
534+ )
535+ yield self ._build_watched_movies (data )
536+
537+ @property
514538 def watched_movies (self ):
515539 """Watched progress for all :class:`Movie`'s in this :class:`User`'s
516540 collection.
517541 """
518542 if self ._watched_movies is None :
519- data = yield 'users/{user}/watched/movies' .format (
520- user = slugify (self .username )
521- )
522- self ._watched_movies = []
523- for movie in data :
524- movie_data = movie .pop ('movie' )
525- movie_data .update (movie )
526- self ._watched_movies .append (Movie (** movie_data ))
527- yield self ._watched_movies
543+ self ._watched_movies = self .get_watched_movies ()
544+ return self ._watched_movies
528545
529546 @property
530547 @get
0 commit comments