midgetspy/Sick-Beard — pull request #520 by jayme-github (2012-10-30 09:00:22+00:00)
Title: process files by size (smallest first)

I just hat two downloads with similar problems like the one described in sabnzbd/sabnzbd#32. Of cause I have configured Sabnzbd to not download sample files.

The downloaded archive contained two .mkv files, the episode (1.7GB) and a sample (24MB) which was not identifiable as a sample by name.
sabToSickBeard.py first processed the episode.mkv which then got replaced by the (smaller) samle.mkv because the complete archive was marked as priority download due to it was snatched by sick-beard.

With this little change sabToSickBeard.py will process all video files sorted by their filesize (smallest first). In the described case, the samle.mkv would get overriden by episode.mkv. As far as I can say multi-ep archives are processed normally as the names of the video files do match against episode numbers.

Sorry for the pull-request (based off development branch) but it seems as if it is not possible to change existing ones (?) ...