summaryrefslogtreecommitdiff
path: root/items.c
diff options
context:
space:
mode:
Diffstat (limited to 'items.c')
-rw-r--r--items.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/items.c b/items.c
index c1e1564..2c7b094 100644
--- a/items.c
+++ b/items.c
@@ -113,20 +113,28 @@ parse_album_xml (const char *filename, TAlbum *index)
g_free (s);
s = g_strdup_printf ("/gallery/items/item[%d]/nofullsize", i + 1);
- item->nofullsize = xml_file_get_node_present (xml, s);
+ item->nofullsize = (xml_file_get_node_present (xml, s) || item->path == NULL);
g_free (s);
- g_ptr_array_add (index->items, item);
+ if (item->path || item->preview)
+ {
+ g_ptr_array_add (index->items, item);
+ }
+ else
+ {
+ fprintf (stderr, "%s: No image src specified, skipping!\n", filename);
+ free (item);
+ }
}
xml_parser_close (xml);
/* Print the items */
#ifdef __DEBUG_ALL__
- printf("ID = '%s'\ntitle = '%s'\ndescription = '%s'\n", index->ID, index->title, index->desc);
+ printf ("ID = '%s'\ntitle = '%s'\ndescription = '%s'\n", index->ID, index->title, index->desc);
for (i = 0; i < index->items->len; i++) {
- TIndexItem *item = g_ptr_array_index(index->items, i);
- printf("item %d: path = '%s', title = '%s', title_description = '%s', thumbnail = '%s'\n",
+ TIndexItem *item = g_ptr_array_index (index->items, i);
+ printf ("item %d: path = '%s', title = '%s', title_description = '%s', thumbnail = '%s'\n",
i, item->path, item->title, item->title_description, item->thumbnail);
}
#endif