When attempting to play a movie through Seren, playback fails and throws a TypeError related to sorting in the _get_best_torrent_to_cache() function. This appears to be caused by a comparison between an integer and a string in the seeds field of one or more torrent sources.
To Reproduce
-
Open Seren
-
Search for and select a movie
-
Allow Seren to scrape sources
-
Attempt to play any of the results
-
Observe the error
Expected behavior
Seren should successfully sort available torrent sources by seed count and play the selected source, even if some seed values are strings instead of integers.
Actual behavior:
Playback fails with the following
TypeError: '<' not supported between instances of 'int' and 'str'
Traceback :
File "/addons/plugin.video.seren/resources/lib/modules/getSources.py", line 427, in _get_best_torrent_to_cache
sorted_list = sorted(package_type_list, key=lambda k: k['seeds'], reverse=True)
TypeError: '<' not supported between instances of 'int' and 'str'
Environment Info:
- Seren version: 3.0.1
- Kodi version: 20.5
- Platform/Device: Ubuntu 24.04.3 LTS ( Kernel : Linux 6.14.0-33-Generic
- Provider package: A4KScrapers, Real-Debrid
Settings: Default settings, with torrent caching enabled (or specify any overrides)
Additional context
TypeError: '<' not supported between instances of 'int' and 'str'
When attempting to play a movie through Seren, playback fails and throws a TypeError related to sorting in the _get_best_torrent_to_cache() function. This appears to be caused by a comparison between an integer and a string in the seeds field of one or more torrent sources.
To Reproduce
Open Seren
Search for and select a movie
Allow Seren to scrape sources
Attempt to play any of the results
Observe the error
Expected behavior
Seren should successfully sort available torrent sources by seed count and play the selected source, even if some seed values are strings instead of integers.
Actual behavior:
Playback fails with the following
TypeError: '<' not supported between instances of 'int' and 'str'Traceback :
File "/addons/plugin.video.seren/resources/lib/modules/getSources.py", line 427, in _get_best_torrent_to_cache
sorted_list = sorted(package_type_list, key=lambda k: k['seeds'], reverse=True)
TypeError: '<' not supported between instances of 'int' and 'str'
Environment Info:
Settings: Default settings, with torrent caching enabled (or specify any overrides)
Additional context
TypeError: '<' not supported between instances of 'int' and 'str'