You can now pause and unpause feeds

This commit is contained in:
2022-12-20 03:28:14 +01:00
parent 83383634b6
commit bbb8ff51bc
2 changed files with 29 additions and 0 deletions

View File

@ -193,6 +193,26 @@ async def create_feed(feed_url: str = Form(), webhook_dropdown: str = Form()) ->
return RedirectResponse(url=f"/feed/?feed_url={feed_url}", status_code=303)
@app.post("/pause")
async def pause_feed(feed_url: str = Form()) -> dict[str, str] | RedirectResponse:
clean_url: str = urllib.parse.quote(feed_url)
# Disable/pause the feed.
reader.disable_feed_updates(feed_url)
return RedirectResponse(url=f"/feed/?feed_url={clean_url}", status_code=303)
@app.post("/unpause")
async def unpause_feed(feed_url: str = Form()) -> dict[str, str] | RedirectResponse:
clean_url: str = urllib.parse.quote(feed_url)
# Enable/unpause the feed.
reader.enable_feed_updates(feed_url)
return RedirectResponse(url=f"/feed/?feed_url={clean_url}", status_code=303)
@app.get("/add", response_class=HTMLResponse)
def get_add(request: Request) -> _TemplateResponse:
"""