Version 65 file rename improvement

This commit is contained in:
Hydrus 2013-04-10 15:48:55 -05:00
parent 81de5a75dd
commit b292c15b44
2 changed files with 17 additions and 10 deletions

View File

@ -8,7 +8,7 @@
<div class="content">
<h3>changelog</h3>
<ul>
<li><h3>version 64</h3></li>
<li><h3>version 65</h3></li>
<ul>
<li>added subscriptions dialog</li>
<li>added prototype subscription daemon, but not yet activated it</li>

View File

@ -5089,15 +5089,22 @@ class DB( ServiceDB ):
for filename in filenames:
old_path = HC.CLIENT_FILES_DIR + os.path.sep + filename
mime = HC.GetMimeFromPath( old_path )
new_path = old_path + HC.mime_ext_lookup[ mime ]
shutil.move( old_path, new_path )
os.chmod( new_path, stat.S_IREAD )
if '.' not in filename:
try:
old_path = HC.CLIENT_FILES_DIR + os.path.sep + filename
mime = HC.GetMimeFromPath( old_path )
new_path = old_path + HC.mime_ext_lookup[ mime ]
shutil.move( old_path, new_path )
os.chmod( new_path, stat.S_IREAD )
except: pass
i += 1