Version 67 DeleteOrphans improvement
This commit is contained in:
parent
328a014200
commit
5d8f93c759
|
@ -17,6 +17,7 @@
|
|||
<li>subs and repos will automatically pause while their respective dialogs are open</li>
|
||||
<li>new namespace | regex listctrl in regex dialog, instead of old sctvcp rubbish</li>
|
||||
<li>new /aa/aa...0 file storage system for client</li>
|
||||
<li>fixed deleteorphans mime issue</li>
|
||||
<li>export and copy files now export writeable files, not read-only</li>
|
||||
<li>rejiggered daemon db access, improving maintenance reliablity</li>
|
||||
<li>dumper and 'show in new page' pages now process content updates correctly</li>
|
||||
|
|
|
@ -1728,13 +1728,38 @@ class ServiceDB( FileDB, MessageDB, TagDB, RatingDB ):
|
|||
|
||||
for hash in local_files_hashes & deletee_hashes:
|
||||
|
||||
with self._hashes_to_mimes_lock: mime = self._hashes_to_mimes[ hash ]
|
||||
with self._hashes_to_mimes_lock:
|
||||
|
||||
# not sure why I'm ever getting a key error here, but let's recover from it anyway!
|
||||
|
||||
if hash in self._hashes_to_mimes: mime = self._hashes_to_mimes[ hash ]
|
||||
else: mime = None
|
||||
|
||||
|
||||
path = CC.GetFilePath( hash, mime )
|
||||
|
||||
os.chmod( path, stat.S_IWRITE )
|
||||
|
||||
os.remove( path )
|
||||
if mime is None:
|
||||
|
||||
for mime in HC.ALLOWED_MIMES:
|
||||
|
||||
path = CC.GetFilePath( hash, mime )
|
||||
|
||||
if os.path.exists( path ):
|
||||
|
||||
os.chmod( path, stat.S_IWRITE )
|
||||
|
||||
os.remove( path )
|
||||
|
||||
break
|
||||
|
||||
|
||||
|
||||
else:
|
||||
|
||||
path = CC.GetFilePath( hash, mime )
|
||||
|
||||
os.chmod( path, stat.S_IWRITE )
|
||||
|
||||
os.remove( path )
|
||||
|
||||
|
||||
|
||||
# perceptual_hashes and thumbs
|
||||
|
|
Loading…
Reference in New Issue