|
|
@ -115,6 +115,7 @@ QMap<QString, QMap<QString, WebApplication::Action> > WebApplication::initialize |
|
|
|
ADD_ACTION(command, bottomPrio); |
|
|
|
ADD_ACTION(command, bottomPrio); |
|
|
|
ADD_ACTION(command, recheck); |
|
|
|
ADD_ACTION(command, recheck); |
|
|
|
ADD_ACTION(command, setCategory); |
|
|
|
ADD_ACTION(command, setCategory); |
|
|
|
|
|
|
|
ADD_ACTION(command, addCategory); |
|
|
|
ADD_ACTION(command, getSavePath); |
|
|
|
ADD_ACTION(command, getSavePath); |
|
|
|
ADD_ACTION(version, api); |
|
|
|
ADD_ACTION(version, api); |
|
|
|
ADD_ACTION(version, api_min); |
|
|
|
ADD_ACTION(version, api_min); |
|
|
@ -728,6 +729,21 @@ void WebApplication::action_command_setCategory() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void WebApplication::action_command_addCategory() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
CHECK_URI(0); |
|
|
|
|
|
|
|
CHECK_PARAMETERS("category"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString category = request().posts["category"].trimmed(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!BitTorrent::Session::isValidCategoryName(category) && !category.isEmpty()) { |
|
|
|
|
|
|
|
status(400, tr("Incorrect category name")); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BitTorrent::Session::instance()->addCategory(category); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WebApplication::action_command_getSavePath() |
|
|
|
void WebApplication::action_command_getSavePath() |
|
|
|
{ |
|
|
|
{ |
|
|
|
CHECK_URI(0); |
|
|
|
CHECK_URI(0); |
|
|
|