Improve docs and security defaults
This commit is contained in:
@@ -241,7 +241,9 @@ class SeriesApp:
|
||||
message="Download cancelled before starting"
|
||||
)
|
||||
|
||||
# Wrap callback to check for cancellation and report progress
|
||||
# Wrap callback to enforce cancellation checks and bridge the new
|
||||
# event-driven progress reporting with the legacy callback API that
|
||||
# the CLI still relies on.
|
||||
def wrapped_callback(progress: float):
|
||||
if self._is_cancelled():
|
||||
raise InterruptedError("Download cancelled by user")
|
||||
@@ -268,6 +270,9 @@ class SeriesApp:
|
||||
if callback:
|
||||
callback(progress)
|
||||
|
||||
# Propagate progress into the legacy callback chain so existing
|
||||
# UI surfaces continue to receive updates without rewriting the
|
||||
# old interfaces.
|
||||
# Call legacy progress_callback if provided
|
||||
if self.progress_callback:
|
||||
self.progress_callback(ProgressInfo(
|
||||
@@ -403,7 +408,9 @@ class SeriesApp:
|
||||
# Reinitialize scanner
|
||||
self.SerieScanner.reinit()
|
||||
|
||||
# Wrap callback for progress reporting and cancellation
|
||||
# Wrap the scanner callback so we can surface progress through the
|
||||
# new ProgressInfo pipeline while maintaining backwards
|
||||
# compatibility with the legacy tuple-based callback signature.
|
||||
def wrapped_callback(folder: str, current: int):
|
||||
if self._is_cancelled():
|
||||
raise InterruptedError("Scan cancelled by user")
|
||||
|
||||
Reference in New Issue
Block a user