From 9c3e60f34eaf5eba2c7b2289a0155d142227aa55 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 8 Aug 2016 15:53:28 +0800 Subject: [PATCH] Implement advanced multi-part movie detection (via group by mediainfo) --- source/net/filebot/media/MediaDetection.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/net/filebot/media/MediaDetection.java b/source/net/filebot/media/MediaDetection.java index 5b01fca4..3023a150 100644 --- a/source/net/filebot/media/MediaDetection.java +++ b/source/net/filebot/media/MediaDetection.java @@ -1087,12 +1087,16 @@ public class MediaDetection { filesByMediaFolder.stream().collect(groupingBy(f -> { if (VIDEO_FILES.accept(f)) { try (MediaInfo mi = new MediaInfo().open(f)) { - return mi.get(StreamKind.General, 0, "Encoded_Date"); + String v = mi.get(StreamKind.Video, 0, "Codec"); + String a = mi.get(StreamKind.Audio, 0, "Codec"); + String w = mi.get(StreamKind.Video, 0, "Width"); + String h = mi.get(StreamKind.Video, 0, "Height"); + return asList(v, a, w, h); } catch (Exception e) { debug.warning(format("Failed to read media characteristics: %s", e.getMessage())); } } - return ""; + return emptyList(); })).forEach((group, videos) -> groups.add(videos)); }); });