fix #26
This commit is contained in:
parent
54591d4bc9
commit
7813d139d9
@ -77,11 +77,10 @@ namespace AUR {
|
|||||||
|
|
||||||
public Json.Object? info (string pkgname) {
|
public Json.Object? info (string pkgname) {
|
||||||
unowned Json.Object? pkg_info = null;
|
unowned Json.Object? pkg_info = null;
|
||||||
string uri = rpc_url + rpc_info + pkgname;
|
string uri = rpc_url + rpc_info + Uri.escape_string (pkgname);
|
||||||
var session = new Soup.Session ();
|
var session = new Soup.Session ();
|
||||||
var message = new Soup.Message ("GET", uri);
|
var message = new Soup.Message ("GET", uri);
|
||||||
session.send_message (message);
|
session.send_message (message);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var parser = new Json.Parser ();
|
var parser = new Json.Parser ();
|
||||||
parser.load_from_data ((string) message.response_body.flatten ().data, -1);
|
parser.load_from_data ((string) message.response_body.flatten ().data, -1);
|
||||||
@ -100,16 +99,14 @@ namespace AUR {
|
|||||||
builder.append (rpc_multiinfo);
|
builder.append (rpc_multiinfo);
|
||||||
foreach (string pkgname in pkgnames) {
|
foreach (string pkgname in pkgnames) {
|
||||||
builder.append (rpc_multiinfo_arg);
|
builder.append (rpc_multiinfo_arg);
|
||||||
builder.append (pkgname);
|
builder.append (Uri.escape_string (pkgname));
|
||||||
}
|
}
|
||||||
var session = new Soup.Session ();
|
var session = new Soup.Session ();
|
||||||
var message = new Soup.Message ("GET", builder.str);
|
var message = new Soup.Message ("GET", builder.str);
|
||||||
session.send_message (message);
|
session.send_message (message);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var parser = new Json.Parser ();
|
var parser = new Json.Parser ();
|
||||||
parser.load_from_data ((string) message.response_body.flatten ().data, -1);
|
parser.load_from_data ((string) message.response_body.flatten ().data, -1);
|
||||||
|
|
||||||
unowned Json.Object root_object = parser.get_root ().get_object ();
|
unowned Json.Object root_object = parser.get_root ().get_object ();
|
||||||
results = root_object.get_array_member ("results");
|
results = root_object.get_array_member ("results");
|
||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user