* check original filename for embedded CRC32 checksums

This commit is contained in:
Reinhard Pointner 2014-07-09 18:55:46 +00:00
parent ff3babd131
commit 27472cb656
1 changed files with 11 additions and 7 deletions

View File

@ -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)
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);