* script compatibility fixes

This commit is contained in:
Reinhard Pointner 2014-04-19 07:46:46 +00:00
parent 2199e67357
commit ea942d41e2
3 changed files with 19 additions and 3 deletions

View File

@ -1,7 +1,6 @@
package net.filebot.cli;
import static java.util.Collections.*;
import static java.util.EnumSet.*;
import static net.filebot.Settings.*;
import static net.filebot.cli.CLILogging.*;
import static net.filebot.util.StringUtilities.*;
@ -21,11 +20,13 @@ import java.net.Socket;
import java.util.ArrayList;
import java.util.Date;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.logging.Logger;
import javax.script.Bindings;
@ -427,7 +428,10 @@ public abstract class ScriptShellBaseClass extends Script {
}
ArgumentBean defaultValues = Settings.getApplicationArguments();
for (Option missing : complementOf(copyOf(options.keySet()))) {
Set<Option> complement = EnumSet.allOf(Option.class);
complement.removeAll(options.keySet());
for (Option missing : complement) {
switch (missing) {
case forceExtractAll:
options.put(missing, false);

View File

@ -174,6 +174,18 @@ public class ScriptShellMethods {
return FileUtilities.sortByUniquePath(mediaFolders);
}
public static List<File> eachMediaFolder(Collection<?> folders, Closure<?> closure) throws IOException {
List<File> mediaFolders = new ArrayList<File>();
for (File root : FileUtilities.asFileList(folders)) {
mediaFolders.addAll(getMediaFolders(root));
}
// remove duplicates
mediaFolders = FileUtilities.sortByUniquePath(mediaFolders);
return DefaultGroovyMethods.each(mediaFolders, closure);
}
public static String getNameWithoutExtension(File self) {
return FileUtilities.getNameWithoutExtension(self.getName());
}

View File

@ -145,7 +145,7 @@
please <a href="http://www.filebot.net/forums/viewtopic.php?f=4&amp;t=5">share it with us</a>.
</p>
<div style="margin: 12px 300px 20px 25px; padding: 5px; border: thin dotted lavender; background: #FDFDFF">
<span style="text-decoration: underline">Script Index:</span><br><ul style="margin:3px"><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p802" class="postlink">µTorrent / Deluge / Transmission Integration</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p204" class="postlink">Fetch Artwork and Nfo for TV Shows</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p205" class="postlink">Fetch Artwork and Nfo for Movies</a></li><li><a href="http://www.filebot.net/forums/viewtopic.php?f=4&amp;t=5#p8871" class="postlink">Fetch all subtitles</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p1341" class="postlink">The Cleaner - Delete left over files and folders</a></li><li><a href="http://www.filebot.net/forums/viewtopic.php?f=4&amp;t=5#p5394" class="postlink">View or Clear Extended Attributes</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p2100" class="postlink">Filename: Find &amp; Replace</a></li><li><a href="http://www.filebot.net/forums/viewtopic.php?f=4&amp;t=5#p7188" class="postlink">Convert Absolute to SxE numbers</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p53" class="postlink">Media Index CSV</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p2459" class="postlink">Query Rename History</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p2485" class="postlink">Revert Renamed Files to their Original Names</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;p=2629#p2629" class="postlink">MyEpisodes.com Integration</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p2211" class="postlink">Rename All Media Folder by Folder</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p512" class="postlink">Auto-Sort Tivo Recordings</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p52" class="postlink">Sort out TV Download Folder</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p132" class="postlink">Watch folder and rename new episodes</a>
<span style="text-decoration: underline">Script Index:</span><br><ul style="margin:3px"><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p802" class="postlink">µTorrent / Deluge / Transmission Integration</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p204" class="postlink">Fetch Artwork and Nfo for TV Shows</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p205" class="postlink">Fetch Artwork and Nfo for Movies</a></li><li><a href="http://www.filebot.net/forums/viewtopic.php?f=4&amp;t=5#p8871" class="postlink">Fetch subtitles for all files</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p1341" class="postlink">The Cleaner - Delete left over files and folders</a></li><li><a href="http://www.filebot.net/forums/viewtopic.php?f=4&amp;t=5#p5394" class="postlink">View or Clear Extended Attributes</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p2100" class="postlink">Filename: Find &amp; Replace</a></li><li><a href="http://www.filebot.net/forums/viewtopic.php?f=4&amp;t=5#p7188" class="postlink">Convert Absolute to SxE numbers</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p53" class="postlink">Media Index CSV</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p2459" class="postlink">Query Rename History</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p2485" class="postlink">Revert Renamed Files to their Original Names</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;p=2629#p2629" class="postlink">MyEpisodes.com Integration</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p2211" class="postlink">Rename All Media Folder by Folder</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p512" class="postlink">Auto-Sort Tivo Recordings</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p52" class="postlink">Sort out TV Download Folder</a></li><li><a href="http://filebot.sourceforge.net/forums/viewtopic.php?f=4&amp;t=5#p132" class="postlink">Watch folder and rename new episodes</a>
</div>
<h3 id="examples">Example Scripts</h3>