mirror of
https://github.com/mitb-archive/filebot
synced 2025-01-11 05:48:01 -05:00
* guess movie name from folder only 2 levels deep
This commit is contained in:
parent
c67b0d0d47
commit
31d7141b41
@ -339,8 +339,9 @@ public class MediaDetection {
|
|||||||
|
|
||||||
|
|
||||||
public static File guessMovieFolder(File movieFile) throws IOException {
|
public static File guessMovieFolder(File movieFile) throws IOException {
|
||||||
// first meaningful parent folder
|
// first meaningful parent folder (max 2 levels deep)
|
||||||
for (File f = movieFile.getParentFile(); f != null; f = f.getParentFile()) {
|
File f = movieFile.getParentFile();
|
||||||
|
for (int i = 0; f != null && i < 2; f = f.getParentFile(), i++) {
|
||||||
String term = stripReleaseInfo(f.getName());
|
String term = stripReleaseInfo(f.getName());
|
||||||
if (term.length() > 0) {
|
if (term.length() > 0) {
|
||||||
return f;
|
return f;
|
||||||
|
@ -305,7 +305,7 @@ class MovieHashMatcher implements AutoCompleteMatcher {
|
|||||||
// multiple results have been found, user must select one
|
// multiple results have been found, user must select one
|
||||||
SelectDialog<Movie> selectDialog = new SelectDialog<Movie>(parent, options);
|
SelectDialog<Movie> selectDialog = new SelectDialog<Movie>(parent, options);
|
||||||
|
|
||||||
selectDialog.setTitle(String.format("%s / %s", folderQuery, fileQuery));
|
selectDialog.setTitle(folderQuery.isEmpty() ? fileQuery : String.format("%s / %s", folderQuery, fileQuery));
|
||||||
selectDialog.getHeaderLabel().setText(String.format("Movies matching '%s':", fileQuery.length() >= 2 || folderQuery.length() <= 2 ? fileQuery : folderQuery));
|
selectDialog.getHeaderLabel().setText(String.format("Movies matching '%s':", fileQuery.length() >= 2 || folderQuery.length() <= 2 ? fileQuery : folderQuery));
|
||||||
selectDialog.getCancelAction().putValue(Action.NAME, "Ignore");
|
selectDialog.getCancelAction().putValue(Action.NAME, "Ignore");
|
||||||
selectDialog.pack();
|
selectDialog.pack();
|
||||||
|
Loading…
Reference in New Issue
Block a user