* better sample handling
This commit is contained in:
parent
c029e3ca8a
commit
fe0d152d8f
|
@ -16,6 +16,8 @@ import java.awt.geom.Rectangle2D;
|
|||
import java.awt.geom.RoundRectangle2D;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
import javax.swing.JList;
|
||||
|
@ -24,6 +26,7 @@ import javax.swing.border.EmptyBorder;
|
|||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import net.sourceforge.filebot.ResourceManager;
|
||||
import net.sourceforge.filebot.media.MediaDetection;
|
||||
import net.sourceforge.filebot.similarity.Match;
|
||||
import net.sourceforge.filebot.similarity.MetricCascade;
|
||||
import net.sourceforge.filebot.similarity.MetricMin;
|
||||
|
@ -218,13 +221,22 @@ class RenameListCellRenderer extends DefaultFancyListCellRenderer {
|
|||
|
||||
|
||||
protected String getType(File file) {
|
||||
if (file.isDirectory())
|
||||
if (file.isDirectory()) {
|
||||
return "Folder";
|
||||
}
|
||||
|
||||
try {
|
||||
if (MediaDetection.getClutterFileFilter().accept(file)) {
|
||||
return "Sample";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logger.getLogger(getClass().getName()).log(Level.WARNING, e.getMessage());
|
||||
}
|
||||
|
||||
String extension = FileUtilities.getExtension(file);
|
||||
|
||||
if (extension != null)
|
||||
if (extension != null) {
|
||||
return extension.toLowerCase();
|
||||
}
|
||||
|
||||
// some file with no extension
|
||||
return "File";
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
(sample|trailer)-
|
||||
(sample|trailer)[.]
|
||||
-(sample|trailer)
|
||||
-s[.]
|
||||
\((sample|trailer)\)
|
||||
\[(sample|trailer)\]
|
||||
^(sample|trailer)
|
Loading…
Reference in New Issue