From e6495596505de6112c2d6b5c03d7e967809fa4ef Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Sun, 11 Aug 2019 14:52:51 +0300 Subject: [PATCH] Allow to refresh RSS item(s) via WebAPI --- src/webui/api/rsscontroller.cpp | 10 ++++++++++ src/webui/api/rsscontroller.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/webui/api/rsscontroller.cpp b/src/webui/api/rsscontroller.cpp index 5c541f72c..bbc88e729 100644 --- a/src/webui/api/rsscontroller.cpp +++ b/src/webui/api/rsscontroller.cpp @@ -91,6 +91,16 @@ void RSSController::itemsAction() setResult(jsonVal.toObject()); } +void RSSController::refreshItemAction() +{ + checkParams({"itemPath"}); + + const QString itemPath {params()["itemPath"]}; + RSS::Item *item = RSS::Session::instance()->itemByPath(itemPath); + if (item) + item->refresh(); +} + void RSSController::setRuleAction() { checkParams({"ruleName", "ruleDef"}); diff --git a/src/webui/api/rsscontroller.h b/src/webui/api/rsscontroller.h index 4c72a2e09..a4d22e051 100644 --- a/src/webui/api/rsscontroller.h +++ b/src/webui/api/rsscontroller.h @@ -44,6 +44,7 @@ private slots: void removeItemAction(); void moveItemAction(); void itemsAction(); + void refreshItemAction(); void setRuleAction(); void renameRuleAction(); void removeRuleAction();