rivenmedia / riven

Handle your Media Library with ease!
https://rivenmedia.github.io/wiki/
GNU General Public License v3.0
404 stars 54 forks source link

[Bug] Combined episodes causes get_cached_streams to fail #805

Open filiptrplan opened 1 month ago

filiptrplan commented 1 month ago

In the get_cached_container of the FileFinder class we do a check that the container length should be at least as long as the media requested.

if not needed_media or len(container) >= len([episode for season in needed_media for episode in needed_media[season]]):
    matched_files = self.cache_matches(container, needed_media, break_pointer)
    if matched_files:
        return {"all_files": container, "matched_files": matched_files}

So for this magnet link magnet:?xt=urn:btih:b92fe904bd2b62822b80f1755c0e8c9b363044d9 which has only 23 files for 24 episodes the check fails. But the episodes 1 and 2 are in the same file.

dreulavelle commented 1 month ago

just minus 1 from len() and make it greater than or equal to