Skip to content

AttributeError: 'Movie' object has no attribute 'trakt' #158

Description

@Ashish0804

Looks like trakt was never initialized and thus error.

return {'ids': {'trakt': self.trakt, 'slug': self.slug,

Changing it to trakt_id should fix things but I haven't tested it myself.

Here's the full error log

Traceback (most recent call last):
  File ".\add2traktlist.py", line 56, in <module>
    main()
  File ".\add2traktlist.py", line 51, in main
    traktList.add_items(trakt_object)
  File "C:\Users\Ashish\Anaconda3\lib\site-packages\trakt\core.py", line 586, in inner
    url, generator, args = self._get_first(f, *args, **kwargs)
  File "C:\Users\Ashish\Anaconda3\lib\site-packages\trakt\core.py", line 494, in _get_first
    uri = next(generator)
  File "C:\Users\Ashish\Anaconda3\lib\site-packages\trakt\users.py", line 160, in add_items
    movies = [m.ids for m in items if isinstance(m, Movie)]
  File "C:\Users\Ashish\Anaconda3\lib\site-packages\trakt\users.py", line 160, in <listcomp>
    movies = [m.ids for m in items if isinstance(m, Movie)]
  File "C:\Users\Ashish\Anaconda3\lib\site-packages\trakt\movies.py", line 194, in ids
    return {'ids': {'trakt': self.trakt, 'slug': self.slug,
AttributeError: 'Movie' object has no attribute 'trakt'

Here's how Movie object is being used in my code

Movie(title=res['Title'], imdb_id=res['imdbID'])

res is the response for OMDB api.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions