now updating file size in the database when the file has changed.
authorerik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Thu, 1 Mar 2007 17:45:27 +0000 (17:45 +0000)
committererik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Thu, 1 Mar 2007 17:45:27 +0000 (17:45 +0000)
trunk/mythtv/src/main/java/org/wamblee/mythtv/LinkStructure.java

index 7effde65b830ce580600e97351d940c7b1dcb767..486723373f60e3e39de5e651f5adaf6a48313653 100644 (file)
@@ -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()) {