public class GoogleMovie : Movie {
public string cinema_name;
public string cinema_phone;
- public string runtime;
+ public int runtime;
public string showtimes;
}
timeinfo.hour = hour;
showtime = timeinfo.mktime ();
- int runtime = 3600 * movie.runtime.to_int () + 60 * movie.runtime.str ("hr ").offset (3).to_int ();
+ int runtime = movie.runtime;
if (runtime == 0) {
// Default to 120min if we failed to parse the runtime
runtime = 7200;
movie.rating = (int) object.get_double_member ("rating");
movie.cinema_name = object.get_string_member ("cinema_name");
movie.cinema_phone = object.get_string_member ("cinema_phone");
+ movie.runtime = (int) object.get_int_member ("runtime");
movie.showtimes = object.get_string_member ("showtimes");
- movie.secondary = movie.cinema_name + " - " + movie.showtimes;
+ if (movie.runtime > 0)
+ movie.secondary = "%d min - %s - %s".printf (movie.runtime / 60, movie.cinema_name, movie.showtimes);
+ else
+ movie.secondary = movie.cinema_name + " - " + movie.showtimes;
callback (movie);
}