From 744f61a29160b90c38f47f7857684a4698f7392b Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 12 May 2019 02:11:41 +0700 Subject: [PATCH] Prefer direct descendant video files when formatting folder objects https://www.filebot.net/forums/viewtopic.php?f=8&t=10797 --- source/net/filebot/format/MediaBindingBean.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/net/filebot/format/MediaBindingBean.java b/source/net/filebot/format/MediaBindingBean.java index 0c2ca18f..e80f359b 100644 --- a/source/net/filebot/format/MediaBindingBean.java +++ b/source/net/filebot/format/MediaBindingBean.java @@ -1142,7 +1142,11 @@ public class MediaBindingBean { if (file.isDirectory()) { // just select the first video file in the folder as media sample - List videos = listFiles(file, VIDEO_FILES, CASE_INSENSITIVE_PATH_ORDER); + List 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); }