|
|
@ -102,6 +102,7 @@ const QString Str_AssignedCategory(QStringLiteral("assignedCategory")); |
|
|
|
const QString Str_LastMatch(QStringLiteral("lastMatch")); |
|
|
|
const QString Str_LastMatch(QStringLiteral("lastMatch")); |
|
|
|
const QString Str_IgnoreDays(QStringLiteral("ignoreDays")); |
|
|
|
const QString Str_IgnoreDays(QStringLiteral("ignoreDays")); |
|
|
|
const QString Str_AddPaused(QStringLiteral("addPaused")); |
|
|
|
const QString Str_AddPaused(QStringLiteral("addPaused")); |
|
|
|
|
|
|
|
const QString Str_CreateSubfolder(QStringLiteral("createSubfolder")); |
|
|
|
const QString Str_SmartFilter(QStringLiteral("smartFilter")); |
|
|
|
const QString Str_SmartFilter(QStringLiteral("smartFilter")); |
|
|
|
const QString Str_PreviouslyMatched(QStringLiteral("previouslyMatchedEpisodes")); |
|
|
|
const QString Str_PreviouslyMatched(QStringLiteral("previouslyMatchedEpisodes")); |
|
|
|
|
|
|
|
|
|
|
@ -123,6 +124,7 @@ namespace RSS |
|
|
|
QString savePath; |
|
|
|
QString savePath; |
|
|
|
QString category; |
|
|
|
QString category; |
|
|
|
TriStateBool addPaused = TriStateBool::Undefined; |
|
|
|
TriStateBool addPaused = TriStateBool::Undefined; |
|
|
|
|
|
|
|
TriStateBool createSubfolder = TriStateBool::Undefined; |
|
|
|
|
|
|
|
|
|
|
|
bool smartFilter = false; |
|
|
|
bool smartFilter = false; |
|
|
|
QStringList previouslyMatchedEpisodes; |
|
|
|
QStringList previouslyMatchedEpisodes; |
|
|
@ -144,6 +146,7 @@ namespace RSS |
|
|
|
&& (savePath == other.savePath) |
|
|
|
&& (savePath == other.savePath) |
|
|
|
&& (category == other.category) |
|
|
|
&& (category == other.category) |
|
|
|
&& (addPaused == other.addPaused) |
|
|
|
&& (addPaused == other.addPaused) |
|
|
|
|
|
|
|
&& (createSubfolder == other.createSubfolder) |
|
|
|
&& (smartFilter == other.smartFilter); |
|
|
|
&& (smartFilter == other.smartFilter); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
@ -439,6 +442,7 @@ QJsonObject AutoDownloadRule::toJsonObject() const |
|
|
|
, {Str_LastMatch, lastMatch().toString(Qt::RFC2822Date)} |
|
|
|
, {Str_LastMatch, lastMatch().toString(Qt::RFC2822Date)} |
|
|
|
, {Str_IgnoreDays, ignoreDays()} |
|
|
|
, {Str_IgnoreDays, ignoreDays()} |
|
|
|
, {Str_AddPaused, triStateBoolToJsonValue(addPaused())} |
|
|
|
, {Str_AddPaused, triStateBoolToJsonValue(addPaused())} |
|
|
|
|
|
|
|
, {Str_CreateSubfolder, triStateBoolToJsonValue(createSubfolder())} |
|
|
|
, {Str_SmartFilter, useSmartFilter()} |
|
|
|
, {Str_SmartFilter, useSmartFilter()} |
|
|
|
, {Str_PreviouslyMatched, QJsonArray::fromStringList(previouslyMatchedEpisodes())}}; |
|
|
|
, {Str_PreviouslyMatched, QJsonArray::fromStringList(previouslyMatchedEpisodes())}}; |
|
|
|
} |
|
|
|
} |
|
|
@ -455,6 +459,7 @@ AutoDownloadRule AutoDownloadRule::fromJsonObject(const QJsonObject &jsonObj, co |
|
|
|
rule.setSavePath(jsonObj.value(Str_SavePath).toString()); |
|
|
|
rule.setSavePath(jsonObj.value(Str_SavePath).toString()); |
|
|
|
rule.setCategory(jsonObj.value(Str_AssignedCategory).toString()); |
|
|
|
rule.setCategory(jsonObj.value(Str_AssignedCategory).toString()); |
|
|
|
rule.setAddPaused(jsonValueToTriStateBool(jsonObj.value(Str_AddPaused))); |
|
|
|
rule.setAddPaused(jsonValueToTriStateBool(jsonObj.value(Str_AddPaused))); |
|
|
|
|
|
|
|
rule.setCreateSubfolder(jsonValueToTriStateBool(jsonObj.value(Str_CreateSubfolder))); |
|
|
|
rule.setLastMatch(QDateTime::fromString(jsonObj.value(Str_LastMatch).toString(), Qt::RFC2822Date)); |
|
|
|
rule.setLastMatch(QDateTime::fromString(jsonObj.value(Str_LastMatch).toString(), Qt::RFC2822Date)); |
|
|
|
rule.setIgnoreDays(jsonObj.value(Str_IgnoreDays).toInt()); |
|
|
|
rule.setIgnoreDays(jsonObj.value(Str_IgnoreDays).toInt()); |
|
|
|
rule.setUseSmartFilter(jsonObj.value(Str_SmartFilter).toBool(false)); |
|
|
|
rule.setUseSmartFilter(jsonObj.value(Str_SmartFilter).toBool(false)); |
|
|
@ -584,6 +589,16 @@ void AutoDownloadRule::setAddPaused(const TriStateBool &addPaused) |
|
|
|
m_dataPtr->addPaused = addPaused; |
|
|
|
m_dataPtr->addPaused = addPaused; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TriStateBool AutoDownloadRule::createSubfolder() const |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return m_dataPtr->createSubfolder; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void AutoDownloadRule::setCreateSubfolder(const TriStateBool &createSubfolder) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
m_dataPtr->createSubfolder = createSubfolder; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString AutoDownloadRule::assignedCategory() const |
|
|
|
QString AutoDownloadRule::assignedCategory() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
return m_dataPtr->category; |
|
|
|
return m_dataPtr->category; |
|
|
|