From: erik Date: Thu, 1 Mar 2007 17:45:27 +0000 (+0000) Subject: now updating file size in the database when the file has changed. X-Git-Tag: wamblee-utils-0.2@603~272 X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;h=65fc23fc7a04b4f9c378a3c8d93d9df0763310f6;p=utils now updating file size in the database when the file has changed. --- diff --git a/trunk/mythtv/src/main/java/org/wamblee/mythtv/LinkStructure.java b/trunk/mythtv/src/main/java/org/wamblee/mythtv/LinkStructure.java index 7effde65..48672337 100644 --- a/trunk/mythtv/src/main/java/org/wamblee/mythtv/LinkStructure.java +++ b/trunk/mythtv/src/main/java/org/wamblee/mythtv/LinkStructure.java @@ -74,6 +74,8 @@ public class LinkStructure implements Listener { // Re-assess file type Recording recording = _recordings.get(aFile); LOG.debug("Recording changed " + recording); + recording.setFilesize(aFile.length()); + _database.update(recording); String dir = getDirectory(recording); FileType type = getFileType(aFile); String path = dir + "/" + getFilename(recording, type); @@ -119,6 +121,7 @@ public class LinkStructure implements Listener { LOG.debug("file deleted " + aFile); Recording recording = _recordings.get(aFile); _recordings.remove(recording); + // mythtv will remove the recording from its database itself. LOG.info("recording deleted " + recording); String dir = getDirectory(recording); for (FileType t: FileType.values()) {