Skip to content

Commit

Permalink
Fixed removing old book function
Browse files Browse the repository at this point in the history
  • Loading branch information
qunxyz committed Sep 5, 2016
1 parent 65950f4 commit d986e06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions book2pad
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ class IBooks():

def remove_book(self, book, delete_file = False):
dest = os.path.dirname(self.ibooks_path)
if book['Package Hash'] in self.search_tree:
del self.search_tree[book['Package Hash']]
filename = os.path.basename(book['Path'])
if filename in self.search_tree:
del self.search_tree[filename]
if delete_file:
book_path = os.path.join(dest, os.path.basename(book['Path']))
if os.path.isfile(book_path):
Expand Down

0 comments on commit d986e06

Please sign in to comment.