1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-21 23:38:50 -05:00

Prefer direct descendant video files when formatting folder objects

https://www.filebot.net/forums/viewtopic.php?f=8&t=10797
This commit is contained in:
Reinhard Pointner 2019-05-12 02:11:41 +07:00
parent d3530b971d
commit 744f61a291

View File

@ -1142,7 +1142,11 @@ public class MediaBindingBean {
if (file.isDirectory()) {
// just select the first video file in the folder as media sample
List<File> videos = listFiles(file, VIDEO_FILES, CASE_INSENSITIVE_PATH_ORDER);
List<File> videos = getChildren(file, VIDEO_FILES, HUMAN_NAME_ORDER);
if (videos.isEmpty()) {
// check for indirect descendant video files as well
videos = listFiles(file, VIDEO_FILES, HUMAN_NAME_ORDER);
}
if (videos.size() > 0) {
return videos.get(0);
}