feat: add download-all endpoint for watchlist items

This commit is contained in:
root
2026-02-27 13:57:01 +00:00
parent 24567b58cf
commit 13b017a206
+1 -7
View File
@@ -2088,9 +2088,7 @@ async def check_watchlist_item(
raise
except Exception as e:
logger.error(f"Error checking watchlist item: {e}", exc_info=True)
except Exception as e:
logger.error(f"Error checking watchlist item: {e}", exc_info=True)
raise HTTPException(status_code=500, detail=str(e))
raise HTTPException(status_code=500, detail=str(e))
@app.post("/api/watchlist/{item_id}/download-all", tags=["Watchlist"])
@@ -2104,7 +2102,6 @@ async def download_all_episodes(
if not item:
raise HTTPException(status_code=404, detail="Watchlist item not found")
# Check ownership
if item.user_id != current_user.id:
raise HTTPException(status_code=403, detail="Access denied")
@@ -2121,7 +2118,6 @@ async def download_all_episodes(
"result": result
}
finally:
# Restore original value (the check will update it)
item.last_episode_downloaded = original_last_episode
watchlist_manager.db.commit()
except HTTPException:
@@ -2131,9 +2127,7 @@ async def download_all_episodes(
raise HTTPException(status_code=500, detail=str(e))
@app.post("/api/watchlist/{item_id}/pause", response_model=WatchlistItem, tags=["Watchlist"])
TB|@app.post("/api/watchlist/{item_id}/pause", response_model=WatchlistItem, tags=["Watchlist"])
@app.post("/api/watchlist/{item_id}/pause", response_model=WatchlistItem, tags=["Watchlist"])