mirror of
https://github.com/mitb-archive/filebot
synced 2025-01-09 04:48:38 -05:00
Added -no-history
and -clear-history
CLI options
This commit is contained in:
parent
2553d11494
commit
cf48247601
@ -8,7 +8,7 @@ Next Release (4.8.6)
|
|||||||
* Evaluate `{closures}` automatically in `String.plus(Closure)` constructs (e.g. `{"[" + {n} + " " + {s00e00} + "]"}`)
|
* Evaluate `{closures}` automatically in `String.plus(Closure)` constructs (e.g. `{"[" + {n} + " " + {s00e00} + "]"}`)
|
||||||
* Ensure that `ActionPopup` is always displayed on top of the Windows Task Bar
|
* Ensure that `ActionPopup` is always displayed on top of the Windows Task Bar
|
||||||
* Improved `-mediainfo -exec` pipeline
|
* Improved `-mediainfo -exec` pipeline
|
||||||
* Added `-no-history` CLI option
|
* Added `-no-history` and `-clear-history` CLI options
|
||||||
* Allow dynamic code evaluation (e.g. `evaluate('/path/to/snippet.groovy' as File)`)
|
* Allow dynamic code evaluation (e.g. `evaluate('/path/to/snippet.groovy' as File)`)
|
||||||
* Allow `@file.groovy` syntax in `Format Editor` and `Preset Editor` (e.g. `@/path/to/MyFormat.groovy`)
|
* Allow `@file.groovy` syntax in `Format Editor` and `Preset Editor` (e.g. `@/path/to/MyFormat.groovy`)
|
||||||
* Added `--mapper` option (e.g. `--mapper XEM.TheTVDB`)
|
* Added `--mapper` option (e.g. `--mapper XEM.TheTVDB`)
|
||||||
|
@ -81,6 +81,7 @@ public final class HistorySpooler {
|
|||||||
channel.truncate(channel.position());
|
channel.truncate(channel.position());
|
||||||
|
|
||||||
sessionHistory.clear();
|
sessionHistory.clear();
|
||||||
|
sessionHistoryTotalSize = 0;
|
||||||
persistentHistoryTotalSize = history.totalSize();
|
persistentHistoryTotalSize = history.totalSize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -89,6 +90,15 @@ public final class HistorySpooler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public synchronized void clear() throws IOException {
|
||||||
|
log.fine("* Delete " + persistentHistoryFile);
|
||||||
|
persistentHistoryFile.delete();
|
||||||
|
|
||||||
|
sessionHistory.clear();
|
||||||
|
sessionHistoryTotalSize = 0;
|
||||||
|
persistentHistoryTotalSize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
public synchronized void append(Map<File, File> elements) {
|
public synchronized void append(Map<File, File> elements) {
|
||||||
append(elements.entrySet());
|
append(elements.entrySet());
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,13 @@ public class Main {
|
|||||||
System.exit(SUCCESS);
|
System.exit(SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.clearCache() || args.clearUserData()) {
|
if (args.clearCache() || args.clearUserData() || args.clearHistory()) {
|
||||||
|
// clear persistent history
|
||||||
|
if (args.clearHistory) {
|
||||||
|
log.info("Reset history");
|
||||||
|
HistorySpooler.getInstance().clear();
|
||||||
|
}
|
||||||
|
|
||||||
// clear persistent user preferences
|
// clear persistent user preferences
|
||||||
if (args.clearUserData()) {
|
if (args.clearUserData()) {
|
||||||
log.info("Reset preferences");
|
log.info("Reset preferences");
|
||||||
|
@ -153,6 +153,9 @@ public class ArgumentBean {
|
|||||||
@Option(name = "-clear-prefs", usage = "Clear application settings")
|
@Option(name = "-clear-prefs", usage = "Clear application settings")
|
||||||
public boolean clearPrefs = false;
|
public boolean clearPrefs = false;
|
||||||
|
|
||||||
|
@Option(name = "-clear-history", usage = "Clear application history")
|
||||||
|
public boolean clearHistory = false;
|
||||||
|
|
||||||
@Option(name = "-version", usage = "Print version identifier")
|
@Option(name = "-version", usage = "Print version identifier")
|
||||||
public boolean version = false;
|
public boolean version = false;
|
||||||
|
|
||||||
@ -189,6 +192,10 @@ public class ArgumentBean {
|
|||||||
return clearPrefs;
|
return clearPrefs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean clearHistory() {
|
||||||
|
return clearHistory;
|
||||||
|
}
|
||||||
|
|
||||||
public List<File> getFiles(boolean resolveFolders) throws Exception {
|
public List<File> getFiles(boolean resolveFolders) throws Exception {
|
||||||
if (arguments == null || arguments.isEmpty()) {
|
if (arguments == null || arguments.isEmpty()) {
|
||||||
return emptyList();
|
return emptyList();
|
||||||
|
Loading…
Reference in New Issue
Block a user