This commit is contained in:
Reinhard Pointner 2016-09-28 13:34:04 +08:00
parent b1a30e4bc3
commit d829ef97c8
3 changed files with 9 additions and 8 deletions

View File

@ -16,7 +16,6 @@ import javax.swing.ListSelectionModel;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableModel;
import net.filebot.util.FileUtilities;
import net.filebot.util.ui.LoadingOverlayPane;
import net.filebot.web.Episode;
import net.filebot.web.Movie;
@ -49,14 +48,16 @@ class AttributeTool extends Tool<TableModel> {
}
@Override
protected TableModel createModelInBackground(File root) throws InterruptedException {
protected TableModel createModelInBackground(File root) {
FileAttributesTableModel model = new FileAttributesTableModel();
if (root == null) {
return model;
}
for (File file : filter(FileUtilities.listFiles(root), VIDEO_FILES, SUBTITLE_FILES)) {
List<File> files = filter(listFiles(root), VIDEO_FILES, SUBTITLE_FILES);
for (File file : files) {
Object metaObject = xattr.getMetaInfo(file);
String originalName = xattr.getOriginalName(file);

View File

@ -1,5 +1,6 @@
package net.filebot.ui.filter;
import static java.util.Collections.*;
import static net.filebot.Logging.*;
import static net.filebot.UserFiles.*;
import static net.filebot.util.ExceptionUtilities.*;
@ -77,7 +78,7 @@ class ExtractTool extends Tool<TableModel> {
@Override
protected TableModel createModelInBackground(File root) throws InterruptedException {
List<File> files = (root != null) ? FileUtilities.listFiles(root) : new ArrayList<File>();
List<File> files = root != null ? listFiles(root) : emptyList();
List<ArchiveEntry> entries = new ArrayList<ArchiveEntry>();
try {

View File

@ -24,7 +24,6 @@ import javax.swing.table.TableModel;
import net.filebot.mediainfo.MediaInfo;
import net.filebot.mediainfo.MediaInfo.StreamKind;
import net.filebot.util.FileUtilities;
import net.filebot.util.ui.LoadingOverlayPane;
import net.miginfocom.swing.MigLayout;
@ -54,13 +53,13 @@ class MediaInfoTool extends Tool<TableModel> {
}
@Override
protected TableModel createModelInBackground(File root) throws InterruptedException {
protected TableModel createModelInBackground(File root) {
if (root == null) {
return new MediaInfoTableModel();
}
List<File> files = filter(FileUtilities.listFiles(root), VIDEO_FILES, AUDIO_FILES);
Map<MediaInfoKey, String[]> data = new TreeMap<>();
List<File> files = filter(listFiles(root), VIDEO_FILES, AUDIO_FILES);
Map<MediaInfoKey, String[]> data = new TreeMap<MediaInfoKey, String[]>();
try (MediaInfo mi = new MediaInfo()) {
IntStream.range(0, files.size()).forEach(f -> {