0.22.0 "TypeError: Object of type method is not JSON serializable"
Jerrk opened this issue · comments
Confirmation
- I have read the README.md on the project homepage
- I have checked if identical issue already exists
The problem
Trying to run plextraktsync to sync my library does not work.
Excluding every library and running plextraktsync DOES work, but will of course only sync the watchlist and no libraries.
I've completely nuked the container and reinstalled from scratch, also deleted the appdata folder and its contents
Error trace / logs
app # plextraktsync
INFO PlexTraktSync [0.22.0]
INFO Sync Movie sections: [<PlexLibrarySection:movie:Documentaries>]
INFO Rating <tmdb:8489:Movie:434602:Ali> with <bound method PlexLibraryItem.rating of <tmdb:8489:Movie:434602:Ali>> on Trakt
Processing Documentaries 0% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/25 [ 0:00:00 < -:--:-- , ? it/s ]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/app/plextraktsync/__main__.py", line 18, in <module>
cli()
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1635, in invoke
rv = super().invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/app/plextraktsync/cli.py", line 46, in cli
sync()
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/app/plextraktsync/cli.py", line 28, in wrap
cmd(*args, **kwargs)
File "/app/plextraktsync/commands/sync.py", line 58, in sync
runner.sync(walker=w, dry_run=config.dry_run)
File "/app/plextraktsync/sync.py", line 88, in sync
self.sync_ratings(movie, dry_run=dry_run)
File "/app/plextraktsync/sync.py", line 142, in sync_ratings
m.trakt_rate()
File "/app/plextraktsync/media.py", line 159, in trakt_rate
self.trakt_api.rate(self.trakt, self.plex_rating)
File "/app/plextraktsync/decorators/nocache.py", line 12, in inner
return method(*args, **kwargs)
File "/app/plextraktsync/decorators/rate_limit.py", line 22, in wrapper
return fn(*args, **kwargs)
File "/app/plextraktsync/decorators/time_limit.py", line 18, in wrapper
return fn(*args, **kwargs)
File "/app/plextraktsync/decorators/retry.py", line 25, in wrapper
return fn(*args, **kwargs)
File "/app/plextraktsync/trakt_api.py", line 226, in rate
m.rate(rating)
File "/usr/local/lib/python3.10/site-packages/trakt/movies.py", line 321, in rate
rate(self, rating)
File "/usr/local/lib/python3.10/site-packages/trakt/core.py", line 587, in inner
json_data = self._handle_request('post', url, data=args)
File "/usr/local/lib/python3.10/site-packages/trakt/core.py", line 526, in _handle_request
data=json.dumps(data))
File "/usr/local/lib/python3.10/json/__init__.py", line 231, in dumps
return _default_encoder.encode(obj)
File "/usr/local/lib/python3.10/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/local/lib/python3.10/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/local/lib/python3.10/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type method is not JSON serializable
Expected behavior
I should be able to run plextraktsync to sync my library
Steps to reproduce the behavior
- Have any library
- run plextraktsync through console
Inspect of problematic items
No response
Workarounds
0.21.6 works
0.22.0 does not
Install method
docker-compose
Version
0.22.0
Python Version
3.10.7
Operating System and Version
Unraid 6.11.0
Workarounds
- 0.21.6 works
- 0.22.0 does not
are you absolutely sure of this? the changes between those two versions only change watch and inspect command:
but your error is from sync command.
i double checked it on 2 different servers both with the same issue.
I have now triple checked it and i still have the issue.
all im doing is changing the repository from
ghcr.io/taxel/plextraktsync:0.22.0
to
ghcr.io/taxel/plextraktsync:0.21.6
should be fixed in 0.22.1 via #1091.