Browse Source

fix #26

tags/v5.1.2
guinux 5 years ago
parent
commit
7813d139d9
1 changed files with 2 additions and 5 deletions
  1. +2
    -5
      src/aur.vala

+ 2
- 5
src/aur.vala View File

@@ -77,11 +77,10 @@ namespace AUR {

public Json.Object? info (string pkgname) {
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 message = new Soup.Message ("GET", uri);
session.send_message (message);

try {
var parser = new Json.Parser ();
parser.load_from_data ((string) message.response_body.flatten ().data, -1);
@@ -100,16 +99,14 @@ namespace AUR {
builder.append (rpc_multiinfo);
foreach (string pkgname in pkgnames) {
builder.append (rpc_multiinfo_arg);
builder.append (pkgname);
builder.append (Uri.escape_string (pkgname));
}
var session = new Soup.Session ();
var message = new Soup.Message ("GET", builder.str);
session.send_message (message);

try {
var parser = new Json.Parser ();
parser.load_from_data ((string) message.response_body.flatten ().data, -1);
unowned Json.Object root_object = parser.get_root ().get_object ();
results = root_object.get_array_member ("results");
} catch (Error e) {


Loading…
Cancel
Save