code: def to_dict(self):
          
  
          result = self.to_identifier()
  
          result.update({
              'title': self.title,
  
              'watched': 1 if self.is_watched else 0,
              'collected': 1 if self.is_collected else 0,
  
              'plays': self.plays if self.plays is not None else 0,
              'in_watchlist': self.in_watchlist if self.in_watchlist is not None else 0,
              'progress': self.progress,
  
              'last_watched_at': to_iso8601_datetime(self.last_watched_at),
              'collected_at': to_iso8601_datetime(self.collected_at),
              'paused_at': to_iso8601_datetime(self.paused_at),
  
              'ids': dict([
                  (key, value) for (key, value) in self.keys[1:]  # NOTE: keys[0] is the (<season>, <episode>) identifier
              ])
          })
  
          if self.rating:
              result['rating'] = self.rating.value
              result['rated_at'] = to_iso8601_datetime(self.rating.timestamp)
  
          # Extended Info
          if self.first_aired:
              result['first_aired'] = to_iso8601_datetime(self.first_aired)
  
          if self.updated_at:
              result['updated_at'] = to_iso8601_datetime(self.updated_at)
  
          if self.overview:
              result['overview'] = self.overview
  
          if self.available_translations:
              result['available_translations'] = self.available_translations
  
          return result
docs: Dump episode to a dictionary.
  
          :return: Episode dictionary
          :rtype: :class:`~python:dict`