Add GLib.TypeModule parameter to plugins
[cinaest] / src / plugins / imdb-plugin.vala
index 2fbf482..64d8bb3 100644 (file)
@@ -174,6 +174,15 @@ class IMDbPlugin : Plugin {
        }
 }
 
+class IMDbMovie : Movie {
+       public override string get_plot () {
+               var sqlite = new IMDbSqlite (Path.build_filename (Environment.get_user_cache_dir (),
+                                            "cinaest", "imdb.db", null));
+               print ("IMDb get_plot(\"%s (%d)\")\n", title, year);
+               return sqlite.get_plot ("%s (%d)".printf (title, year));
+       }
+}
+
 class IMDBSource : MovieSource {
        public override bool active { get; set construct; }
 
@@ -192,7 +201,7 @@ class IMDBSource : MovieSource {
        }
 
        private void receive_movie (string title, string? aka, int year, int rating, int genres) {
-               Movie movie = new Movie ();
+               var movie = new IMDbMovie ();
                movie.title = title;
                movie.year = year;
                movie.rating = rating;
@@ -226,7 +235,7 @@ class IMDBSource : MovieSource {
 }
 
 [ModuleInit]
-public Type register_plugin () {
+public Type register_plugin (TypeModule module) {
        // types are registered automatically
        return typeof (IMDbPlugin);
 }