This commit is contained in:
@@ -541,6 +541,10 @@ async def manual_scan(background_tasks: BackgroundTasks, path: Optional[str] = N
|
||||
raise HTTPException(status_code=400, detail="scan_type must be 'both', 'tv', or 'movies'")
|
||||
|
||||
async def run_scan():
|
||||
from datetime import datetime
|
||||
start_time = datetime.now()
|
||||
print(f"🚀 MANUAL SCAN STARTED: {scan_type} scan initiated at {start_time.strftime('%Y-%m-%d %H:%M:%S')}")
|
||||
|
||||
paths_to_scan = []
|
||||
if path:
|
||||
paths_to_scan = [Path(path)]
|
||||
@@ -620,6 +624,13 @@ async def manual_scan(background_tasks: BackgroundTasks, path: Optional[str] = N
|
||||
print(f"INFO: Processed {movie_count} movies, yielding to other requests...")
|
||||
|
||||
print(f"INFO: Completed movie scan: {movie_count} movies processed in {scan_path}")
|
||||
|
||||
# Log scan completion with duration
|
||||
end_time = datetime.now()
|
||||
duration = end_time - start_time
|
||||
duration_str = str(duration).split('.')[0] # Remove microseconds
|
||||
print(f"✅ MANUAL SCAN COMPLETED: {scan_type} scan finished at {end_time.strftime('%Y-%m-%d %H:%M:%S')}")
|
||||
print(f"⏱️ MANUAL SCAN DURATION: {duration_str} (total time: {duration.total_seconds():.1f} seconds)")
|
||||
|
||||
background_tasks.add_task(run_scan)
|
||||
return {"status": "started", "message": f"Manual {scan_type} scan started"}
|
||||
|
||||
Reference in New Issue
Block a user