Skip to content

TypeError in _get_best_torrent_to_cache: '<' not supported between 'int' and 'str' #963

Description

@Mehraj-hub

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

  1. Open Seren

  2. Search for and select a movie

  3. Allow Seren to scrape sources

  4. Attempt to play any of the results

  5. 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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions