mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-24 00:38:52 -05:00
Improved default behaviour
This commit is contained in:
parent
3768f656ef
commit
e08e461369
@ -1102,7 +1102,7 @@ public class CmdlineOperations implements CmdlineInterface {
|
||||
}
|
||||
}
|
||||
|
||||
ExpressionFormat formatter = new ExpressionFormat(format != null && format.length() > 0 ? format : "{fn} [{resolution} {af} {vc} {ac}]");
|
||||
ExpressionFormat formatter = new ExpressionFormat(format != null && format.length() > 0 ? format : "{fn} [{resolution} {vc} {channels} {ac} {minutes+'m'}]");
|
||||
List<String> output = new ArrayList<String>();
|
||||
for (File file : files) {
|
||||
String line = formatter.format(new MediaBindingBean(readMetaInfo(file), file, null));
|
||||
|
@ -17,6 +17,7 @@ import java.io.PrintStream;
|
||||
import java.io.StringWriter;
|
||||
import java.net.Socket;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.EnumMap;
|
||||
import java.util.EnumSet;
|
||||
@ -418,7 +419,15 @@ public abstract class ScriptShellBaseClass extends Script {
|
||||
}
|
||||
}
|
||||
|
||||
public String getMediaInfo(Map<String, ?> parameters) throws Exception {
|
||||
public String getMediaInfo(File file, String format) throws Exception {
|
||||
return cli.getMediaInfo(singleton(file), format, null).get(0); // explicitly ignore the --filter option
|
||||
}
|
||||
|
||||
public List<String> getMediaInfo(Collection<?> files, String format) throws Exception {
|
||||
return cli.getMediaInfo(FileUtilities.asFileList(files), format, null); // explicitly ignore the --filter option
|
||||
}
|
||||
|
||||
public Object getMediaInfo(Map<String, ?> parameters) throws Exception {
|
||||
List<File> input = getInputFileList(parameters);
|
||||
if (input == null || input.isEmpty()) {
|
||||
return null;
|
||||
@ -427,8 +436,12 @@ public abstract class ScriptShellBaseClass extends Script {
|
||||
Map<Option, Object> option = getDefaultOptions(parameters);
|
||||
synchronized (cli) {
|
||||
try {
|
||||
List<String> lines = cli.getMediaInfo(singleton(input.get(0)), asString(option.get(Option.format)), null); // explicitly ignore the --filter option if any
|
||||
return lines.get(0);
|
||||
List<String> lines = cli.getMediaInfo(input, asString(option.get(Option.format)), asString(option.get(Option.filter)));
|
||||
if (parameters.containsKey("file") && !(parameters.get("file") instanceof Collection)) {
|
||||
return lines.get(0); // HACK for script backwards compatibility
|
||||
} else {
|
||||
return lines;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
printException(e, false);
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user