From 27472cb65620f680056734f915fd77c9cb1cda5c Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Wed, 9 Jul 2014 18:55:46 +0000 Subject: [PATCH] * check original filename for embedded CRC32 checksums --- .../net/filebot/format/MediaBindingBean.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/source/net/filebot/format/MediaBindingBean.java b/source/net/filebot/format/MediaBindingBean.java index 1ec77d2e..5e674fac 100644 --- a/source/net/filebot/format/MediaBindingBean.java +++ b/source/net/filebot/format/MediaBindingBean.java @@ -385,16 +385,20 @@ public class MediaBindingBean { File inferredMediaFile = getInferredMediaFile(); // try to get checksum from file name - String checksum = getEmbeddedChecksum(inferredMediaFile.getName()); - - if (checksum != null) - return checksum; + for (String filename : new String[] { getOriginalFileName(inferredMediaFile), inferredMediaFile.getName() }) { + if (filename != null) { + String checksum = getEmbeddedChecksum(filename); + if (checksum != null) { + return checksum; + } + } + } // try to get checksum from sfv file - checksum = getHashFromVerificationFile(inferredMediaFile, HashType.SFV, 3); - - if (checksum != null) + String checksum = getHashFromVerificationFile(inferredMediaFile, HashType.SFV, 3); + if (checksum != null) { return checksum; + } // calculate checksum from file return crc32(inferredMediaFile);