[RELEASE] Texture Cache Maintenance utility
(2013-03-24, 15:42)MilhouseVH Wrote: Ah... Windows user... penny just dropped. I think I know what happened.

A week or so ago I updated the code to use os.sep on paths to improve Windows compatability (os.sep being "/" on Linux, "\" on Windows), and I also used os.sep when forming the hash (directory + filename) that is calculated as the orphan scan option walks the Thumbnails directory. So on Linux the hash for a file would be formed as "f/ffd2826e.jpg", and on Windows it would be "f\ffd2826e.jpg". This value is then matched against the database hash, to see if it exists or not (is an orphan), and this is where the problem lies... The database hash, I've now realised, always uses the Linux "/" format, so _nothing_ in the database matched against the calculated hashes under Windows, and all files were considered orphans! Oops, very sorry. My fault. Blush

v0.2.5 is updated as follows:

* Fix hash so that always uses Linux path seperator

* Apply 5% limit when identifying files for orphan removal. If the number of orphaned files exceeds 5% of the total database files (rows), the R operation will be aborted before any files are removed.
Hehe, I was just about to post that probably the problem was in this line:
hash = "%s%s%s" % (dir, os.sep, f)
but it seems that you already found out.Wink

The safety measure for the R option is very thoughtful.

Messages In This Thread
RE: [RELEASE] Texture Cache maintenance utility - by charrua - 2013-03-24, 16:00
Crash on Gotham on OS X - by desepticon - 2014-05-29, 17:57
Cleaning - by AleisterHH - 2018-05-28, 22:03
RE: Cleaning - by Milhouse - 2018-05-28, 22:16
qax genre not updated - by Just-Me_A-User - 2018-06-12, 22:06
RE: qax genre not updated - by Milhouse - 2018-06-12, 23:40

Logout Mark Read Team Forum Stats Members Help
[RELEASE] Texture Cache Maintenance utility17
This forum uses Lukasz Tkacz MyBB addons.