mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
refactor(app): improve code readability and consistency in FileMonitorHandler
- Rename 'size' parameter to 'file_size' in on_created and on_moved methods - This change enhances code clarity and maintains consistency with other parts of the codebase
This commit is contained in:
+2
-2
@@ -40,11 +40,11 @@ class FileMonitorHandler(FileSystemEventHandler):
|
|||||||
|
|
||||||
def on_created(self, event: FileSystemEvent):
|
def on_created(self, event: FileSystemEvent):
|
||||||
self.callback.event_handler(event=event, text="创建", event_path=event.src_path,
|
self.callback.event_handler(event=event, text="创建", event_path=event.src_path,
|
||||||
size=Path(event.src_path).stat().st_size)
|
file_size=Path(event.src_path).stat().st_size)
|
||||||
|
|
||||||
def on_moved(self, event: FileSystemMovedEvent):
|
def on_moved(self, event: FileSystemMovedEvent):
|
||||||
self.callback.event_handler(event=event, text="移动", event_path=event.dest_path,
|
self.callback.event_handler(event=event, text="移动", event_path=event.dest_path,
|
||||||
size=Path(event.dest_path).stat().st_size)
|
file_size=Path(event.dest_path).stat().st_size)
|
||||||
|
|
||||||
|
|
||||||
class Monitor(metaclass=Singleton):
|
class Monitor(metaclass=Singleton):
|
||||||
|
|||||||
Reference in New Issue
Block a user