mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-11 11:55:03 -05:00
* language favorites can now be restored after restart
* stricter embedded checksum pattern * fixed weird selection behavior in subtitle files list
This commit is contained in:
parent
d85d6c6356
commit
7ec6d49475
16
build.xml
16
build.xml
@ -21,14 +21,6 @@
|
|||||||
|
|
||||||
<!-- main jar -->
|
<!-- main jar -->
|
||||||
<jar destfile="${dir.dist}/filebot.jar">
|
<jar destfile="${dir.dist}/filebot.jar">
|
||||||
<manifest>
|
|
||||||
<attribute name="Built-By" value="${user.name}" />
|
|
||||||
<attribute name="Built-Date" value="${today}" />
|
|
||||||
<attribute name="Application-Name" value="${title}" />
|
|
||||||
<attribute name="Application-Version" value="${version}" />
|
|
||||||
<attribute name="Main-Class" value="net.sourceforge.filebot.Main" />
|
|
||||||
</manifest>
|
|
||||||
|
|
||||||
<fileset dir="${dir.build}" excludes="**/*Test*" />
|
<fileset dir="${dir.build}" excludes="**/*Test*" />
|
||||||
</jar>
|
</jar>
|
||||||
|
|
||||||
@ -44,6 +36,14 @@
|
|||||||
<mkdir dir="${dir.dist}/fatjar" />
|
<mkdir dir="${dir.dist}/fatjar" />
|
||||||
|
|
||||||
<jar destfile="${dir.dist}/fatjar/FileBot.jar" filesetmanifest="merge" duplicate="fail">
|
<jar destfile="${dir.dist}/fatjar/FileBot.jar" filesetmanifest="merge" duplicate="fail">
|
||||||
|
<manifest>
|
||||||
|
<attribute name="Built-By" value="${user.name}" />
|
||||||
|
<attribute name="Built-Date" value="${today}" />
|
||||||
|
<attribute name="Application-Name" value="${title}" />
|
||||||
|
<attribute name="Application-Version" value="${version}" />
|
||||||
|
<attribute name="Main-Class" value="net.sourceforge.filebot.Main" />
|
||||||
|
</manifest>
|
||||||
|
|
||||||
<!-- include main jar -->
|
<!-- include main jar -->
|
||||||
<zipfileset src="${dir.dist}/filebot.jar" />
|
<zipfileset src="${dir.dist}/filebot.jar" />
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ public final class FileBotUtilities {
|
|||||||
* checksum string is a hex number with at least 8 digits. Capturing group 0 will contain
|
* checksum string is a hex number with at least 8 digits. Capturing group 0 will contain
|
||||||
* the matched checksum string.
|
* the matched checksum string.
|
||||||
*/
|
*/
|
||||||
public static final Pattern EMBEDDED_CHECKSUM_PATTERN = Pattern.compile("(?<=\\[|\\()(\\p{XDigit}{8,})(?=\\]|\\))");
|
public static final Pattern EMBEDDED_CHECKSUM_PATTERN = Pattern.compile("(?<=\\[|\\()(\\p{XDigit}{8})(?=\\]|\\))");
|
||||||
|
|
||||||
|
|
||||||
public static String getEmbeddedChecksum(CharSequence string) {
|
public static String getEmbeddedChecksum(CharSequence string) {
|
||||||
@ -55,6 +55,7 @@ public final class FileBotUtilities {
|
|||||||
|
|
||||||
|
|
||||||
public static String removeEmbeddedChecksum(String string) {
|
public static String removeEmbeddedChecksum(String string) {
|
||||||
|
// match embedded checksum and surrounding brackets
|
||||||
return string.replaceAll("[\\(\\[]\\p{XDigit}{8}[\\]\\)]", "");
|
return string.replaceAll("[\\(\\[]\\p{XDigit}{8}[\\]\\)]", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,6 +101,11 @@ class SubtitleDownloadComponent extends JComponent {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// better selection behaviour
|
||||||
|
EventSelectionModel<MemoryFile> fileSelection = new EventSelectionModel<MemoryFile>(files);
|
||||||
|
fileSelection.setSelectionMode(ListSelection.MULTIPLE_INTERVAL_SELECTION_DEFENSIVE);
|
||||||
|
fileList.setSelectionModel(fileSelection);
|
||||||
|
|
||||||
// install dnd and clipboard export handler
|
// install dnd and clipboard export handler
|
||||||
MemoryFileListExportHandler memoryFileExportHandler = new MemoryFileListExportHandler();
|
MemoryFileListExportHandler memoryFileExportHandler = new MemoryFileListExportHandler();
|
||||||
fileList.setTransferHandler(new DefaultTransferHandler(null, memoryFileExportHandler, memoryFileExportHandler));
|
fileList.setTransferHandler(new DefaultTransferHandler(null, memoryFileExportHandler, memoryFileExportHandler));
|
||||||
|
@ -53,7 +53,7 @@ public class SubtitlePanel extends AbstractSearchPanel<SubtitleProvider, Subtitl
|
|||||||
|
|
||||||
// restore favorite languages
|
// restore favorite languages
|
||||||
for (String favoriteLanguage : persistentFavoriteLanguages) {
|
for (String favoriteLanguage : persistentFavoriteLanguages) {
|
||||||
languageModel.favorites().add(0, Language.getLanguage(favoriteLanguage));
|
languageModel.favorites().add(languageModel.favorites().size(), Language.getLanguage(favoriteLanguage));
|
||||||
}
|
}
|
||||||
|
|
||||||
// guess favorite languages
|
// guess favorite languages
|
||||||
@ -75,7 +75,7 @@ public class SubtitlePanel extends AbstractSearchPanel<SubtitleProvider, Subtitl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String get(int index) {
|
public String get(int index) {
|
||||||
return languageModel.favorites().get(0).getCode();
|
return languageModel.favorites().get(index).getCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user