- Add the ability to parse the RSS feeds from reddit groups (in particular the image feed groups like EarthPorn) and display them

This commit is contained in:
Alfred Reynolds
2021-08-22 15:10:26 +12:00
parent 3557b6041f
commit 833e7ef915
9 changed files with 271 additions and 15 deletions

View File

@@ -180,6 +180,10 @@ QVector<PathEntry> parsePathEntry(QJsonObject &jsonMainDoc, bool baseRecursive,
if(!imageListString.empty()) {
entry.imageList = imageListString;
}
std::string rssFeedURLString = ParseJSONString(schedulerJson, "redditrss");
if(!rssFeedURLString.empty()) {
entry.rssFeedURL = rssFeedURLString;
}
SetJSONBool(entry.exclusive, schedulerJson, "exclusive");
@@ -229,7 +233,7 @@ AppConfig loadAppConfiguration(const AppConfig &commandLineConfig) {
QJsonDocument d = QJsonDocument::fromJson(val.toUtf8());
QJsonObject jsonDoc = d.object();
bool baseRecursive, baseShuffle, baseSorted;
bool baseRecursive = false, baseShuffle = false, baseSorted = false;
SetJSONBool(baseRecursive, jsonDoc, "recursive");
SetJSONBool(baseShuffle, jsonDoc, "shuffle");
SetJSONBool(baseSorted, jsonDoc, "sorted");
@@ -258,6 +262,11 @@ AppConfig loadAppConfiguration(const AppConfig &commandLineConfig) {
{
entry.imageList = imageListString;
}
std::string rssFeedURLString = ParseJSONString(jsonDoc, "redditrss");
if(!rssFeedURLString.empty())
{
entry.rssFeedURL = rssFeedURLString;
}
loadedConfig.paths.append(entry);
}
loadedConfig.configPath = commandLineConfig.configPath;