var movie_parser = new MovieLineParser (sqlite);
var genre_parser = new GenreLineParser (sqlite);
var rating_parser = new RatingLineParser (sqlite);
+ var aka_parser = new AkaLineParser (sqlite);
+ var plot_parser = new PlotLineParser (sqlite);
var downloader = new IMDbFtpDownloader (cancellable);
downloader.progress_changed.connect (on_progress_changed);
if (MOVIES in flags) {
description_changed ("Downloading movie list ...");
downloader.download (url + "movies.list.gz", movie_parser);
- description_changed ("Creating title index ...");
- sqlite.create_title_index ();
}
- percent_finished = 33;
+ percent_finished = 20;
if (GENRES in flags) {
description_changed ("Downloading genre data ...");
downloader.download (url + "genres.list.gz", genre_parser);
}
- percent_finished = 66;
+ percent_finished = 40;
if (RATINGS in flags) {
description_changed ("Downloading rating data ...");
downloader.download (url + "ratings.list.gz", rating_parser);
}
+ percent_finished = 60;
+ if (AKAS in flags) {
+ description_changed ("Downloading alternative titles ...");
+ downloader.download (url + "aka-titles.list.gz", aka_parser);
+ }
+ percent_finished = 80;
+ if (PLOTS in flags) {
+ description_changed ("Downloading plots ...");
+ print ("Downloading Plots");
+ downloader.download (url + "plot.list.gz", plot_parser);
+ }
} catch (Error e2) {
if (e2 is IOError.CANCELLED)
stdout.printf ("Download cancelled.\n");
}
description_changed ("Creating indices ...");
- sqlite.create_votes_index ();
+ if (AKAS in flags)
+ sqlite.create_aka_index ();
+ if (MOVIES in flags)
+ sqlite.create_votes_index ();
if (!cancellable.is_cancelled ()) {
stdout.printf ("Download complete.\n");
}
private void on_progress_changed (int percent) {
- progress (percent_finished + percent / 3);
+ progress (percent_finished + percent / 5);
}
private void timeout_quit () {