feat: add download-all endpoint for watchlist items
This commit is contained in:
@@ -2086,8 +2086,6 @@ async def check_watchlist_item(
|
|||||||
return result
|
return result
|
||||||
except HTTPException:
|
except HTTPException:
|
||||||
raise
|
raise
|
||||||
except Exception as e:
|
|
||||||
logger.error(f"Error checking watchlist item: {e}", exc_info=True)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error checking watchlist item: {e}", exc_info=True)
|
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))
|
||||||
@@ -2104,7 +2102,6 @@ async def download_all_episodes(
|
|||||||
if not item:
|
if not item:
|
||||||
raise HTTPException(status_code=404, detail="Watchlist item not found")
|
raise HTTPException(status_code=404, detail="Watchlist item not found")
|
||||||
|
|
||||||
# Check ownership
|
|
||||||
if item.user_id != current_user.id:
|
if item.user_id != current_user.id:
|
||||||
raise HTTPException(status_code=403, detail="Access denied")
|
raise HTTPException(status_code=403, detail="Access denied")
|
||||||
|
|
||||||
@@ -2121,7 +2118,6 @@ async def download_all_episodes(
|
|||||||
"result": result
|
"result": result
|
||||||
}
|
}
|
||||||
finally:
|
finally:
|
||||||
# Restore original value (the check will update it)
|
|
||||||
item.last_episode_downloaded = original_last_episode
|
item.last_episode_downloaded = original_last_episode
|
||||||
watchlist_manager.db.commit()
|
watchlist_manager.db.commit()
|
||||||
except HTTPException:
|
except HTTPException:
|
||||||
@@ -2131,9 +2127,7 @@ async def download_all_episodes(
|
|||||||
raise HTTPException(status_code=500, detail=str(e))
|
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"])
|
||||||
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"])
|
@app.post("/api/watchlist/{item_id}/pause", response_model=WatchlistItem, tags=["Watchlist"])
|
||||||
|
|||||||
Reference in New Issue
Block a user