note.destroy ();
if (response == ResponseType.OK) {
- download_imdb (window);
+ download_imdb (window, false);
}
}
(void) Config.GETTEXT_PACKAGE;
}
- private void download_imdb (Gtk.Window window) {
+ private void download_imdb (Gtk.Window window, bool plots) {
var picker = new PickerDialog (window);
var selector = new TouchSelector.text ();
string[] mirrors;
picker.destroy();
if (res == ResponseType.OK) {
- var download = new IMDbDownloadDialog (window);
+ var download = new IMDbDownloadDialog (window, plots);
download.run (server, mirror);
download.destroy ();
}
dialog.set_transient_for (window);
dialog.set_title (_("IMDb plugin settings"));
+ bool download_plots;
+ try {
+ var sqlite = new IMDbSqlite (Path.build_filename (Environment.get_user_cache_dir (),
+ "cinaest", "imdb.db", null));
+ download_plots = sqlite.has_plots ();
+ } catch (Error e) {
+ download_plots = false;
+ }
+
+ var plots = new Hildon.CheckButton (SizeType.FINGER_HEIGHT);
+ plots.set_label (_("Download and store movie plots"));
+ plots.set_active (download_plots);
+
string updated;
string filename = Path.build_filename (Environment.get_user_cache_dir(),
"cinaest", "imdb.db", null);
var download = new Hildon.Button.with_text (SizeType.FINGER_HEIGHT, ButtonArrangement.VERTICAL, _("Download"), _("Last update: ") + updated);
VBox content = (VBox) dialog.get_content_area ();
+ content.pack_start (plots, true, true, 0);
content.pack_start (download, true, true, 0);
+ // Connect signals
+ plots.toggled.connect (() => {
+ if (download_plots != plots.get_active ())
+ Hildon.Banner.show_information (window, null, _("Redownload the IMDb for this change to take effect."));
+ });
download.clicked.connect (() => {
- download_imdb (window);
+ download_imdb (window, plots.get_active ());
});
dialog.show_all ();
MovieSource.ReceiveMovieFunction _get_callback;
public override async int get_movies (MovieFilter filter, MovieSource.ReceiveMovieFunction callback, int limit, Cancellable? cancellable) {
- // IMDb has too many movies
- if (filter.title == "" && filter.year_min == 0 && filter.year_max == 0 && filter.genres.field == 0 && filter.rating_min == 0)
- return;
var sqlite = new IMDbSqlite (Path.build_filename (Environment.get_user_cache_dir (),
"cinaest", "imdb.db", null));