rendered paste bodydiff --git a/src/itdb.h b/src/itdb.hindex 840a637..a0040f4 100644--- a/src/itdb.h+++ b/src/itdb.h@@ -1894,6 +1894,8 @@ Itdb_PhotoAlbum *itdb_photodb_photoalbum_create (Itdb_PhotoDB *db, const gchar *albumname, gint pos); Itdb_PhotoDB *itdb_photodb_create (const gchar *mountpoint);+Itdb_PhotoAlbum *itdb_photodb_photoalbum_new (const gchar *albumname);+void itdb_photodb_photoalbum_add (Itdb_PhotoDB *db, Itdb_PhotoAlbum *album, gint pos); void itdb_photodb_free (Itdb_PhotoDB *photodb); gboolean itdb_photodb_write (Itdb_PhotoDB *photodb, GError **error); void itdb_photodb_remove_photo (Itdb_PhotoDB *db,diff --git a/src/itdb_photoalbum.c b/src/itdb_photoalbum.cindex 84febf7..5dd12d3 100644--- a/src/itdb_photoalbum.c+++ b/src/itdb_photoalbum.c@@ -752,7 +752,6 @@ Itdb_PhotoAlbum *itdb_photodb_photoalbum_create (Itdb_PhotoDB *db, Itdb_PhotoAlbum *album; g_return_val_if_fail (db, NULL);- g_return_val_if_fail (albumname, NULL); album = g_new0 (Itdb_PhotoAlbum, 1); album->album_type = 2; /* normal album, set to 1 for Photo Library */@@ -763,6 +762,25 @@ Itdb_PhotoAlbum *itdb_photodb_photoalbum_create (Itdb_PhotoDB *db, return album; } +Itdb_PhotoAlbum *itdb_photodb_photoalbum_new (const gchar *albumname)+{+ Itdb_PhotoAlbum *album;++ g_return_val_if_fail (albumname, NULL);++ album = g_new0 (Itdb_PhotoAlbum, 1);+ album->album_type = 2; /* normal album, set to 1 for Photo Library */+ album->name = g_strdup(albumname);++ return album;+}++void itdb_photodb_photoalbum_add (Itdb_PhotoDB *db, Itdb_PhotoAlbum *album, gint pos)+{+ album->photodb = db;+ db->photoalbums = g_list_insert (db->photoalbums, album, pos);+}+ /** * itdb_photodb_write: * @photodb: the #Itdb_PhotoDB to write to disk