Page 1 of 1

Delete files after successful extraction

Posted: 30 Nov 2012, 16:18
by cheesemaker
Hi,

How do I have to extend the Code to delete the files which have been extracted successfully? (It's out of Fully Automated Media Center)

Code: Select all

// extract archives (zip, rar, etc) that contain at least one video file
input += extract(file: input.findAll{ it.isArchive() }, output: null, conflict: 'override', filter: { it.isVideo() }, forceExtractAll: true)
Thanks,
cheesemaker

Re: Delete files after successful extraction

Posted: 01 Dec 2012, 04:52
by rednoah
extract() should return null if something goes wrong. So just call extract() once for each archive and check the return value, if it's Files you can delete the archive, if it's null something went wrong. That's easy, the main issue is dealing with multi-volume archives.

This script shows you one way of doing it (but it assumes that there's only one single/multi-archive per folder):
http://filebot.sourceforge.net/forums/v ... =4&t=5#p52