chore: update watchlist features and fixes

This commit is contained in:
root
2026-02-28 09:22:57 +00:00
parent 4c96d0c1c5
commit 20bcc75b9b
64 changed files with 5193 additions and 77 deletions
+12 -17
View File
@@ -2088,7 +2088,7 @@ async def check_watchlist_item(
raise
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"])
@@ -2106,20 +2106,18 @@ async def download_all_episodes(
raise HTTPException(status_code=403, detail="Access denied")
# Temporarily set last_episode_downloaded to 0 to trigger download of ALL episodes
original_last_episode = item.last_episode_downloaded
item.last_episode_downloaded = 0
watchlist_manager.db.commit()
watchlist_manager.update(item_id, {"last_episode_downloaded": 0})
try:
result = await episode_checker.manual_check(item_id)
return {
"status": "success",
"message": f"Downloading all episodes for {item.anime_title}",
"result": result
}
finally:
item.last_episode_downloaded = original_last_episode
watchlist_manager.db.commit()
result = await episode_checker.manual_check(item_id)
# Note: download_new_episodes already updates last_episode_downloaded via update_check_time
# So we don't restore the original value - the new value reflects what was actually downloaded
return {
"status": "success",
"message": f"Downloading all episodes for {item.anime_title}",
"result": result
}
except HTTPException:
raise
except Exception as e:
@@ -2127,9 +2125,6 @@ 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"])
@app.post("/api/watchlist/{item_id}/pause", response_model=WatchlistItem, tags=["Watchlist"])
async def pause_watchlist_item(
item_id: str,