added delete option
This commit is contained in:
@@ -295,3 +295,55 @@ class AnimeSettingsRegenerateNfoResponse(BaseModel):
|
||||
default_factory=list,
|
||||
description="Tags that were missing before regeneration",
|
||||
)
|
||||
|
||||
|
||||
class DeleteSeriesRequest(BaseModel):
|
||||
"""Request payload for DELETE /api/anime/{key}.
|
||||
|
||||
Requires typing exactly 'delete' in confirm_text to prevent accidental deletions.
|
||||
"""
|
||||
|
||||
delete_database: bool = Field(
|
||||
default=True,
|
||||
description="Whether to remove the series from the database (default: True)"
|
||||
)
|
||||
delete_folder: bool = Field(
|
||||
default=False,
|
||||
description="Whether to delete the series folder from filesystem (default: False)"
|
||||
)
|
||||
confirm_text: str = Field(
|
||||
...,
|
||||
description="Must be exactly 'delete' to confirm the operation"
|
||||
)
|
||||
|
||||
|
||||
class DeleteSeriesResult(BaseModel):
|
||||
"""Result of a delete operation on a series.
|
||||
|
||||
Tracks what was successfully deleted and any errors encountered.
|
||||
"""
|
||||
|
||||
success: bool = Field(..., description="Whether the operation succeeded")
|
||||
key: str = Field(..., description="Series key that was deleted")
|
||||
name: str = Field(..., description="Series name at time of deletion")
|
||||
deleted_from_database: bool = Field(
|
||||
default=False,
|
||||
description="Whether the series was removed from the database"
|
||||
)
|
||||
deleted_folder: bool = Field(
|
||||
default=False,
|
||||
description="Whether the folder was deleted from filesystem"
|
||||
)
|
||||
folder_path: Optional[str] = Field(
|
||||
None,
|
||||
description="Path to the folder that was (or would be) deleted"
|
||||
)
|
||||
database_error: Optional[str] = Field(
|
||||
None,
|
||||
description="Error message if database deletion failed"
|
||||
)
|
||||
folder_error: Optional[str] = Field(
|
||||
None,
|
||||
description="Error message if folder deletion failed"
|
||||
)
|
||||
message: str = Field(..., description="Human-readable outcome message")
|
||||
|
||||
Reference in New Issue
Block a user