IMDb plugin: make plot downloading optional
[cinaest] / src / plugins / imdb-download-dialog.vala
index 701195c..8173c0d 100644 (file)
@@ -20,8 +20,11 @@ using Gtk;
 using Hildon;
 
 class IMDbDownloadDialog : Note {
-       public IMDbDownloadDialog (Gtk.Window window) {
+       private bool plots;
+
+       public IMDbDownloadDialog (Gtk.Window window, bool _plots) {
                transient_parent = window;
+               plots = _plots;
        }
 
        construct {
@@ -35,7 +38,11 @@ class IMDbDownloadDialog : Note {
                        server.Progress += this.on_progress;
                        server.DescriptionChanged += this.on_description_changed;
 
-                       server.download (mirror, IMDbDownloader.MOVIES | IMDbDownloader.GENRES | IMDbDownloader.RATINGS | IMDbDownloader.AKAS);
+                       int flags = IMDbDownloader.MOVIES | IMDbDownloader.GENRES | IMDbDownloader.RATINGS | IMDbDownloader.AKAS;
+                       if (plots)
+                               flags |= IMDbDownloader.PLOTS;
+
+                       server.download (mirror, flags);
                } catch (DBus.Error e) {
                        warning ("Failed to invoke IMDb downloader: %s", e.message);
                }