From 694c0ec049d1e6ab2ecf015ab54ca90d7d200308 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 26 Jul 2015 11:46:52 +0000 Subject: [PATCH] * allow file.isEpisode() file filter expressions --- source/net/filebot/cli/ScriptShellMethods.java | 4 ++++ source/net/filebot/format/MediaBindingBean.java | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/source/net/filebot/cli/ScriptShellMethods.java b/source/net/filebot/cli/ScriptShellMethods.java index 70979690..f8b2def2 100644 --- a/source/net/filebot/cli/ScriptShellMethods.java +++ b/source/net/filebot/cli/ScriptShellMethods.java @@ -401,4 +401,8 @@ public class ScriptShellMethods { } } + public static boolean isEpisode(File self) { + return MediaDetection.isEpisode(String.join("/", self.getParent(), self.getName()), true); + } + } diff --git a/source/net/filebot/format/MediaBindingBean.java b/source/net/filebot/format/MediaBindingBean.java index c6ff080e..c141e2be 100644 --- a/source/net/filebot/format/MediaBindingBean.java +++ b/source/net/filebot/format/MediaBindingBean.java @@ -91,10 +91,10 @@ public class MediaBindingBean { return getMovie().getName(); if (infoObject instanceof AudioTrack) return getAlbumArtist() != null ? getAlbumArtist() : getArtist(); - if (infoObject instanceof File) - return FileUtilities.getName((File) infoObject); + if (infoObject instanceof File) + return FileUtilities.getName((File) infoObject); - return null; + return null; } @Define("y")