Laev.FilePick (laev v0.1.40)

Copy Markdown View Source

Choosing the right video file inside a torrent — shared by every debrid provider. Files come in as maps with "path" and "bytes" (plus whatever provider-specific keys the caller wants back, e.g. "id").

Summary

Functions

Pick the file to play: the only video, the requested episode from a batch/season pack, or the largest video. {:ok, file} or {:error, :no_video_files}.

Does this file actually hold the episode asked for?

Functions

choose(files, episode, season)

Pick the file to play: the only video, the requested episode from a batch/season pack, or the largest video. {:ok, file} or {:error, :no_video_files}.

names_episode?(path, season, episode)

Does this file actually hold the episode asked for?

choose/3 falls back to the largest file when nothing matches, which is right when a release is one episode named anything — and wrong as an answer to "is episode 13 in this pack?". Anything reusing a pack has to ask this instead, or it will happily play episode 1 again and call it 13.