mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
- Web UI: Display generation information in torrent properties
This commit is contained in:
parent
ce6f665a7b
commit
e35d100769
8 changed files with 210 additions and 53 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue