From 6544e71507dd0abf9e0dc78c0cdc8a39c2f37de1 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 13 Jun 2009 21:27:01 +0000 Subject: [PATCH] * cache calculated checksum as Long, not as (hex) String --- .../filebot/format/EpisodeFormatBindingBean.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/net/sourceforge/filebot/format/EpisodeFormatBindingBean.java b/source/net/sourceforge/filebot/format/EpisodeFormatBindingBean.java index 889fc229..d557cb60 100644 --- a/source/net/sourceforge/filebot/format/EpisodeFormatBindingBean.java +++ b/source/net/sourceforge/filebot/format/EpisodeFormatBindingBean.java @@ -33,7 +33,7 @@ public class EpisodeFormatBindingBean { private MediaInfo mediaInfo; - + public EpisodeFormatBindingBean(Episode episode, File mediaFile) { this.episode = episode; this.mediaFile = mediaFile; @@ -286,7 +286,7 @@ public class EpisodeFormatBindingBean { Element cacheEntry = cache.get(file); if (cacheEntry != null) { - return (String) cacheEntry.getValue(); + return String.format("%08X", cacheEntry.getValue()); } // calculate checksum @@ -308,10 +308,10 @@ public class EpisodeFormatBindingBean { in.close(); } - String checksum = String.format("%08X", crc.getValue()); + // cache calculated checksum + cache.put(new Element(file, crc.getValue())); - cache.put(new Element(file, checksum)); - return checksum; + return String.format("%08X", crc.getValue()); } }