cjlucas/archivedb — Issue #2: File not being updated in database when modified
Author: cjlucas
Created: 2011-10-30 00:52:31+00:00
State: open
Labels: High Priority

```
2011-10-29 17:30:59 DEBUG :
2011-10-29 17:30:59 DEBUG : SELECT `mtime`,`size` FROM `archive` WHERE
watch_dir = '/mnt/user/stuff/movies' and path = '' and filename = 'testing.txt'
[==========================================================================================================] Time: 0:00:00
2011-10-29 17:30:59 DEBUG : INSERT INTO `archive`
(watch_dir, path, filename, md5, mtime, size) VALUES
('/mnt/user/stuff/movies', '', 'testing.txt', '0d599f0ec05c3bda8c3b8a68c32a1b47', '1319934659.0', '5')
2011-10-29 17:31:00 DEBUG :
2011-10-29 17:31:00 DEBUG : SELECT `mtime`,`size` FROM `archive` WHERE
watch_dir = '/mnt/user/stuff/movies' and path = '' and filename = 'testing.txt'
[==========================================================================================================] Time: 0:00:00
2011-10-29 17:31:00 DEBUG : UPDATE `archive` SET `md5` = '7c28d5494f5d030ab701303bdc203393', `mtime`= '1319934660.0'
WHERE watch_dir = '/mnt/user/stuff/movies' and path = ''
and filename = 'testing.txt' and size = '10'
2011-10-29 17:31:00 DEBUG : rows_changed = 0
```

In this example, testing.txt does not get updated in the database because the UPDATE query looks testing.txt with the new file size, not the old size as it should be.