mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
- Web UI: Display generation information in torrent properties
This commit is contained in:
@@ -147,7 +147,7 @@ void HttpConnection::respond()
|
||||
}
|
||||
if (list.size() == 0)
|
||||
list.append("index.html");
|
||||
if (list.size() == 2)
|
||||
if (list.size() >= 2)
|
||||
{
|
||||
if (list[0] == "json")
|
||||
{
|
||||
@@ -156,6 +156,14 @@ void HttpConnection::respond()
|
||||
respondJson();
|
||||
return;
|
||||
}
|
||||
if(list.size() > 2) {
|
||||
if(list[1] == "propertiesGeneral") {
|
||||
qDebug("Web UI Asked for general properties data");
|
||||
QString hash = list[2];
|
||||
respondGenPropertiesJson(hash);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (list[0] == "command")
|
||||
{
|
||||
@@ -210,6 +218,17 @@ void HttpConnection::respondJson()
|
||||
write();
|
||||
}
|
||||
|
||||
void HttpConnection::respondGenPropertiesJson(QString hash) {
|
||||
qDebug("Torrent hash is %s", hash.toLocal8Bit().data());
|
||||
EventManager* manager = parent->eventManager();
|
||||
QString string = json::toJson(manager->getPropGeneralInfo(hash));
|
||||
qDebug("GenProperties JSON is %s", string.toLocal8Bit().data());
|
||||
generator.setStatusLine(200, "OK");
|
||||
generator.setContentTypeByExt("js");
|
||||
generator.setMessage(string);
|
||||
write();
|
||||
}
|
||||
|
||||
void HttpConnection::respondCommand(QString command)
|
||||
{
|
||||
if(command == "download")
|
||||
|
||||
Reference in New Issue
Block a user