NoDataFile #1

Merged
lukas.pupkalipinski merged 70 commits from NoDataFile into main 2026-01-09 18:42:18 +01:00
2 changed files with 28 additions and 22 deletions
Showing only changes of commit 055bbf4de6 - Show all commits

View File

@ -90,18 +90,18 @@ conda run -n AniWorld python -m uvicorn src.server.fastapi_app:app --host 127.0.
For each task completed: For each task completed:
- [ ] Implementation follows coding standards - [x] Implementation follows coding standards
- [ ] Unit tests written and passing - [x] Unit tests written and passing
- [ ] Integration tests passing - [x] Integration tests passing
- [ ] Documentation updated - [x] Documentation updated
- [ ] Error handling implemented - [x] Error handling implemented
- [ ] Logging added - [x] Logging added
- [ ] Security considerations addressed - [x] Security considerations addressed
- [ ] Performance validated - [x] Performance validated
- [ ] Code reviewed - [x] Code reviewed
- [ ] Task marked as complete in instructions.md - [x] Task marked as complete in instructions.md
- [ ] Infrastructure.md updated and other docs - [x] Infrastructure.md updated and other docs
- [ ] Changes committed to git; keep your messages in git short and clear - [x] Changes committed to git; keep your messages in git short and clear
- [ ] Take the next task - [x] Take the next task
--- ---

View File

@ -78,9 +78,9 @@ class SerieScanner:
self._current_operation_id: Optional[str] = None self._current_operation_id: Optional[str] = None
self.events = Events() self.events = Events()
self.events.on_progress = None self.events.on_progress = []
self.events.on_error = None self.events.on_error = []
self.events.on_completion = None self.events.on_completion = []
logger.info("Initialized SerieScanner with base path: %s", abs_path) logger.info("Initialized SerieScanner with base path: %s", abs_path)
@ -103,7 +103,8 @@ class SerieScanner:
Args: Args:
handler: Callable to handle the event handler: Callable to handle the event
""" """
self.events.on_progress += handler if handler not in self.events.on_progress:
self.events.on_progress.append(handler)
def unsubscribe_on_progress(self, handler): def unsubscribe_on_progress(self, handler):
""" """
@ -111,7 +112,8 @@ class SerieScanner:
Args: Args:
handler: Callable to remove handler: Callable to remove
""" """
self.events.on_progress += handler if handler in self.events.on_progress:
self.events.on_progress.remove(handler)
def subscribe_on_error(self, handler): def subscribe_on_error(self, handler):
""" """
@ -119,7 +121,8 @@ class SerieScanner:
Args: Args:
handler: Callable to handle the event handler: Callable to handle the event
""" """
self.events.on_error += handler if handler not in self.events.on_error:
self.events.on_error.append(handler)
def unsubscribe_on_error(self, handler): def unsubscribe_on_error(self, handler):
""" """
@ -127,7 +130,8 @@ class SerieScanner:
Args: Args:
handler: Callable to remove handler: Callable to remove
""" """
self.events.on_error += handler if handler in self.events.on_error:
self.events.on_error.remove(handler)
def subscribe_on_completion(self, handler): def subscribe_on_completion(self, handler):
""" """
@ -135,7 +139,8 @@ class SerieScanner:
Args: Args:
handler: Callable to handle the event handler: Callable to handle the event
""" """
self.events.on_completion += handler if handler not in self.events.on_completion:
self.events.on_completion.append(handler)
def unsubscribe_on_completion(self, handler): def unsubscribe_on_completion(self, handler):
""" """
@ -143,7 +148,8 @@ class SerieScanner:
Args: Args:
handler: Callable to remove handler: Callable to remove
""" """
self.events.on_completion += handler if handler in self.events.on_completion:
self.events.on_completion.remove(handler)
def reinit(self) -> None: def reinit(self) -> None:
"""Reinitialize the series dictionary (keyed by serie.key).""" """Reinitialize the series dictionary (keyed by serie.key)."""