mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-25 06:45:41 +01:00
Better t2b deletion for Cybook
This commit is contained in:
parent
d599956a72
commit
a12b1bd4a4
1 changed files with 3 additions and 5 deletions
|
|
@ -36,17 +36,15 @@ def delete_books(self, paths, end_session=True):
|
|||
os.unlink(path)
|
||||
|
||||
filepath, ext = os.path.splitext(path)
|
||||
basepath, filename = os.path.split(filepath)
|
||||
|
||||
# Delete the ebook auxiliary file
|
||||
if os.path.exists(filepath + '.mbp'):
|
||||
os.unlink(filepath + '.mbp')
|
||||
|
||||
# Delete the thumbnails file auto generated for the ebook
|
||||
for p, d, files in os.walk(basepath):
|
||||
for filen in fnmatch.filter(files, filename + "*.t2b"):
|
||||
os.unlink(os.path.join(p, filen))
|
||||
|
||||
if os.path.exists(filepath + '_6090.t2b'):
|
||||
os.unlink(filepath + '_6090.t2b')
|
||||
|
||||
try:
|
||||
os.removedirs(os.path.dirname(path))
|
||||
except:
|
||||
|
|
|
|||
Loading…
Reference in a new issue