@@ -38,7 +38,7 @@ def on_created(self, event):
3838 book_hash = book_info ['hash' ]
3939 self .library .move_book (book_hash )
4040 self .library .create_library_home ()
41- print (f"[ Added] book: { book_info ['title' ]} " )
41+ print (f"Added book: { book_info ['title' ]} " )
4242
4343 def on_modified (self , event ):
4444 if not event .is_directory and event .src_path .endswith ('.epub' ):
@@ -55,7 +55,7 @@ def on_modified(self, event):
5555 book_hash = book_info ['hash' ]
5656 self .library .move_book (book_hash )
5757 self .library .create_library_home ()
58- print (f"[ Updated] book: { book_info ['title' ]} " )
58+ print (f"Updated book: { book_info ['title' ]} " )
5959
6060 def on_deleted (self , event ):
6161 if not event .is_directory and event .src_path .endswith ('.epub' ):
@@ -72,11 +72,11 @@ def on_deleted(self, event):
7272 book_info = self .library .books [book_hash ]
7373 self .library .remove_book (book_hash )
7474 self .library .create_library_home ()
75- print (f"[ Deleted] book: { book_info ['title' ]} " )
75+ print (f"Deleted book: { book_info ['title' ]} " )
7676
7777 def on_moved (self , event ):
7878 if not event .is_directory and event .src_path .endswith ('.epub' ):
79- title = event .src_path
79+ title = os . path . basename ( event .src_path )
8080 if event .src_path in self .library .file2hash :
8181 book_hash = self .library .file2hash [event .src_path ]
8282 book_info = self .library .books [book_hash ]
@@ -87,15 +87,16 @@ def on_moved(self, event):
8787 book_info = self .library .books [book_hash ]
8888 self .library .remove_book (book_hash )
8989 self .library .create_library_home ()
90- print (f"[ Deleted] book: { book_info ['title' ]} " )
90+ print (f"Deleted book: { book_info ['title' ]} " )
9191 if event .dest_path .endswith ('.epub' ):
92+ print (f"Waiting to add book..." )
9293 if (not os .path .basename (event .dest_path ).startswith ("." )) and (not self .has_hidden_component (event .dest_path )):
9394 ok , book_info = self .library .add_book (event .dest_path )
9495 if ok :
9596 book_hash = book_info ['hash' ]
9697 self .library .move_book (book_hash )
9798 self .library .create_library_home ()
98- print (f"[ Added] book: { book_info ['title' ]} " )
99+ print (f"Added book: { book_info ['title' ]} " )
99100
100101class EPUBWatcher :
101102 def __init__ (self , paths , library ):
0 commit comments