backend: add force rescan parameter to scanner
- Add Force bool field to ScanLibraryRequest in handlers - Pass force param through job params to worker - Add forceRescan field and SetForce method to MediaScanner - Modify processMediaFile to delete and re-create existing items when force=true - Default behavior unchanged (force=false maintains skip-if-exists)
This commit is contained in:
@@ -89,6 +89,7 @@ func SetupRoutes(g *echo.Group, db *database.Queries, connManager *wsync.Connect
|
||||
type ScanLibraryRequest struct {
|
||||
FolderPaths []string `json:"folder_paths,omitempty"`
|
||||
LibraryID string `json:"library_id,omitempty"`
|
||||
Force bool `json:"force,omitempty"`
|
||||
}
|
||||
|
||||
// ScanLibrary handles POST /api/scanner/scan (now runs in background)
|
||||
@@ -155,6 +156,7 @@ func (h *Handler) ScanLibrary(c echo.Context) error {
|
||||
"folders": folderPaths,
|
||||
"admin_id": userUUID.String(),
|
||||
"db": h.db,
|
||||
"force": req.Force,
|
||||
},
|
||||
Status: services.JobStatusPending,
|
||||
Context: h.ctx,
|
||||
|
||||
Reference in New Issue
Block a user