nightly-cb2c44cf-ls181
Pre-releaseCI Report:
https://ci-tests.linuxserver.io/linuxserver/sabnzbd/nightly-cb2c44cf-ls181/index.html
LinuxServer Changes:
No changes
Remote Changes:
Unpack rar sets that par2 moved into a subfolder (#3553)
-
Reproduce bug
-
Let sanitize_filename keep par2 sub-directories
Par2 sets can store their files inside a folder, always using a forward slash as
separator no matter which platform created the set. We replaced that slash with an
underscore, so the name could never match what par2 called the file.
With allow_subdirs the separator is kept and every part is sanitized on its own.
The result stays local to the folder it is used in: empty parts, "." and ".." are
dropped, so neither a leading slash nor any amount of traversal can point outside.
- Write files into the sub-directory par2 names them in
The name from the par2 pack is what we already rename files to, but the separator
was stripped so the file landed flat with an underscore. Post-processing then had
to move it into place afterwards, which is how the volumes ended up somewhere the
unpacker did not look.
Assemble straight into the sub-directory instead. get_unique_filepath() creates the
folder and returns the name relative to the download folder, so nzf.filename now
holds that relative name. analyze_rar_filename() takes the basename, so a setname
still matches what rar_unpack() derives from a path with setname_from_path().
- Match existing files in sub-directories on retry
check_existing_files() listed the job folder without descending into it, so on a
retry the volumes par2 put in a folder of their own were never matched and got
downloaded again.
List the sub-directories too, skipping the admin folder, and match on the name
relative to the job folder. Rename bookkeeping is normalized to the platform
separator, par2 always reports a forward slash.
-
Find rar sets in the job's sub-directories
-
Wait for the direct unpacker to finish
-
Update nzf.setname and nzf.vol after deobfuscating names
-
Fix double extraction
-
Ruff