diff options
Diffstat (limited to 'src/job-manager.c')
| -rw-r--r-- | src/job-manager.c | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/src/job-manager.c b/src/job-manager.c index 3f13b93..28e81ff 100644 --- a/src/job-manager.c +++ b/src/job-manager.c @@ -138,35 +138,37 @@ thread_func (gpointer data) /* actually do some work */ if (item != NULL && job_item != NULL) { - imgname = GET_ITEM_TARGET_FILENAME (item); /* Two-pass check whether images need to be updated. First check does no I/O except of stat() calls. */ needs_update = job->force_update; if (! needs_update) needs_update = generate_image (job->setup, job->items, item, job->path_info, TRUE); - if (needs_update) + + if (needs_update) { + imgname = get_item_target_filename (item); + if (job->setup->verbose) { + G_LOCK (items_print); + g_print (" [%d/%d] Processing item \"%s\"\n", job_item->index, job->total_items, imgname); + G_UNLOCK (items_print); + } + generate_image (job->setup, job->items, item, job->path_info, FALSE); - - if (needs_update && job->setup->verbose) { - G_LOCK (items_print); - g_print (" [%d/%d] Processing item \"%s\"\n", job_item->index, job->total_items, imgname); - G_UNLOCK (items_print); - } - if (needs_update && job->items->type == GALLERY_TYPE_ALBUM) - for (l = g_list_first (job->setup->design->themes); l; l = g_list_next (l)) { - theme = l->data; - /* Do not generate particular image pages when theme doesn't define it */ - if (theme->enabled && theme->picture_template && theme->picture_filename) { - s1 = g_build_filename (job->path_info->templates_root, theme->picture_template, NULL); - s2 = g_strdup_printf (theme->picture_filename, imgname); - s3 = g_build_filename (job->path_info->dest_dir, s2, NULL); - write_html_page (job->setup, job->path_info, theme, s1, s3, job->items, item); - g_free (s1); - g_free (s2); - g_free (s3); + if (job->items->type == GALLERY_TYPE_ALBUM) + for (l = g_list_first (job->setup->design->themes); l; l = g_list_next (l)) { + theme = l->data; + /* Do not generate particular image pages when theme doesn't define it */ + if (theme->enabled && theme->picture_template && theme->picture_filename) { + s1 = g_build_filename (job->path_info->templates_root, theme->picture_template, NULL); + s2 = g_strdup_printf (theme->picture_filename, imgname); + s3 = g_build_filename (job->path_info->dest_dir, s2, NULL); + write_html_page (job->setup, job->path_info, theme, s1, s3, job->items, item); + g_free (s1); + g_free (s2); + g_free (s3); + } } - } - g_free (imgname); + g_free (imgname); + } } } while (item != NULL); @@ -232,7 +234,7 @@ build_tree (TGallerySetup *setup, } /* Read the index file and fill items array */ - items = parse_album_xml (idx_file, path_info); + items = parse_album_xml (setup, idx_file, path_info); if (! items) { log_error ("error reading index file '%s'\n", idx_file); g_free (idx_file); |
