mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-16 22:35:04 -05:00
* allow renaming of single subtitles
This commit is contained in:
parent
469de911e6
commit
0fa092b7ef
@ -71,10 +71,9 @@ public class CmdlineOperations implements CmdlineInterface {
|
|||||||
ExpressionFormat format = (expression != null) ? new ExpressionFormat(expression) : null;
|
ExpressionFormat format = (expression != null) ? new ExpressionFormat(expression) : null;
|
||||||
Locale locale = getLanguage(languageName).toLocale();
|
Locale locale = getLanguage(languageName).toLocale();
|
||||||
|
|
||||||
List<File> videoFiles = filter(files, VIDEO_FILES);
|
List<File> mediaFiles = filter(files, VIDEO_FILES, SUBTITLE_FILES);
|
||||||
|
if (mediaFiles.isEmpty()) {
|
||||||
if (videoFiles.isEmpty()) {
|
throw new IllegalArgumentException("No media files: " + files);
|
||||||
throw new IllegalArgumentException("No video files: " + files);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getEpisodeListProvider(db) != null) {
|
if (getEpisodeListProvider(db) != null) {
|
||||||
@ -90,12 +89,12 @@ public class CmdlineOperations implements CmdlineInterface {
|
|||||||
// auto-determine mode
|
// auto-determine mode
|
||||||
int sxe = 0; // SxE
|
int sxe = 0; // SxE
|
||||||
int cws = 0; // common word sequence
|
int cws = 0; // common word sequence
|
||||||
double max = videoFiles.size();
|
double max = mediaFiles.size();
|
||||||
|
|
||||||
SeriesNameMatcher matcher = new SeriesNameMatcher();
|
SeriesNameMatcher matcher = new SeriesNameMatcher();
|
||||||
String[] cwsList = (max >= 5) ? matcher.matchAll(videoFiles.toArray(new File[0])).toArray(new String[0]) : new String[0];
|
String[] cwsList = (max >= 5) ? matcher.matchAll(mediaFiles.toArray(new File[0])).toArray(new String[0]) : new String[0];
|
||||||
|
|
||||||
for (File f : videoFiles) {
|
for (File f : mediaFiles) {
|
||||||
// count SxE matches
|
// count SxE matches
|
||||||
if (matcher.matchBySeasonEpisodePattern(f.getName()) != null) {
|
if (matcher.matchBySeasonEpisodePattern(f.getName()) != null) {
|
||||||
sxe++;
|
sxe++;
|
||||||
|
Loading…
Reference in New Issue
Block a user