Test if file is valid zip/rar/tar

Enhancement requests or feature requests for future Mylar releases.
Post Reply
bmfrosty
Posts: 14
Joined: Wed May 07, 2014 2:12 am

Test if file is valid zip/rar/tar

Post by bmfrosty »

Sometimes the files on usenet are corrupt. Would love to be able to have file integrity after download. See if it's a valid rar or zip. I know how to do this by hand (for i in *.cbz ; do echo "$i" ; unrar t "$i" >/dev/null ; echo $? ; done), but having mylar do so would be much nicer, since it could then search for an alternate based on success or failure.
User avatar
evilhero
Site Admin
Posts: 2883
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Test if file is valid zip/rar/tar

Post by evilhero »

Mylar actually does this already, albeit in a different type of manner.

If you have metatagging enabled - Mylar will take the given cbr/cbz file and unzip/unrar it. In doing so it actually does what the 't' option does in your example - if the file cannot be opened or a .jpg inside of the archive cannot be extracted, it gets flagged as being an Invalid cbr/cbz file. At that point, it gets rejected by Mylar for post-processing and nothing else happens.

What will happen (eventually is my plans),it will tag it as an invalid - and the nzb/torrent that it used to download the file will be marked as invalid as well (the code for this has already been in place for a while, but it hasn't been fully implemented). It will then attempt to retry the search and then download a different file. Basically failed download handling ;)

So it's just the last part that needs to be implemented, and it's definitely on my to-do list - just some other things have taken a higher priority in my to-do queue simply because when they go wrong, things stop working entirely.

What's very possible that I can include as well, is the option to verify the integrity of every file within a series directory. I know this has happened to me before, where I had a bunch of issues, and by the time I got around to trying to read them (like 2 months later), almost 80% of them were bad/invalid. Definitely would've been good to know well ahead of time and ensure that everything is good.
bmfrosty
Posts: 14
Joined: Wed May 07, 2014 2:12 am

Re: Test if file is valid zip/rar/tar

Post by bmfrosty »

"What's very possible that I can include as well, is the option to verify the integrity of every file within a series directory. I know this has happened to me before, where I had a bunch of issues, and by the time I got around to trying to read them (like 2 months later), almost 80% of them were bad/invalid. Definitely would've been good to know well ahead of time and ensure that everything is good."

I would absolutely love this as well - even a way to go back and scan an entire collection. Also a way to override findings. Scan comes back and calls 99% of the files good and 1% bad - would love to have a page that allowed me to go through and manually check files and determine what should be done with them - either in batch or in detail.

Thank you so much for your hard work. I've even combined this with a working directory for php-cbviewer for remote reading.
Post Reply