summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJorg Schuler <jcsjcs@users.sourceforge.net>2006-09-26 14:53:17 +0000
committerJorg Schuler <jcsjcs@users.sourceforge.net>2006-09-26 14:53:17 +0000
commit1b5011c68b6192806eb6be8c189a4cf19d27ff8e (patch)
treeb12dd004880e1621bb42b5364dab69a7f25cbe12 /tests
parent29613398a7f8ee8396001980d9e25d6b1e121331 (diff)
downloadlibgpod-1b5011c68b6192806eb6be8c189a4cf19d27ff8e.tar.gz
libgpod-1b5011c68b6192806eb6be8c189a4cf19d27ff8e.tar.xz
libgpod-1b5011c68b6192806eb6be8c189a4cf19d27ff8e.zip
* po/sv.po: updated version by Stefan Asserhall
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1323 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'tests')
-rw-r--r--tests/test-photos.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/test-photos.c b/tests/test-photos.c
index a63d51b..7fae6a3 100644
--- a/tests/test-photos.c
+++ b/tests/test-photos.c
@@ -119,6 +119,12 @@ main (int argc, char **argv)
g_print (_("\n"));
g_print (_("Usage to dump all photos to <output_dir>:\n"));
g_print (_("%s dump <mountpoint> <output_dir>\n"), argv[0]);
+ g_print (_("\n"));
+ g_print (_("Usage to delete a photo album:\n"));
+ g_print (_("%s delete <mountpoint> <albumname>\n"), argv[0]);
+ g_print (_("\n"));
+ g_print (_("Usage to rename a photo album:\n"));
+ g_print (_("%s rename <mountpoint> <albumname> <new_albumname>\n"), argv[0]);
return 1;
}
setlocale (LC_ALL, "");
@@ -158,6 +164,50 @@ main (int argc, char **argv)
dump_albums (db, argv[3]);
itdb_photodb_free (db);
}
+ else if (strcmp (argv[1], "delete") == 0)
+ {
+ db = itdb_photodb_parse (argv[2], &error);
+ if (db == NULL)
+ {
+ if (error)
+ {
+ g_print (_("Error reading iPod photo database.(%s)\n"), error->message);
+ g_error_free (error);
+ error = NULL;
+ }
+ else
+ g_print (_("Error reading iPod photo database.\n"));
+
+ return 1;
+ }
+ itdb_photodb_remove_photoalbum( db, argv[3] );
+ g_print (_("Writing to the photo database.\n"));
+ itdb_photodb_write (db, &error);
+ g_print (_("Freeing the photo database.\n"));
+ itdb_photodb_free (db);
+ }
+ else if (strcmp (argv[1], "rename") == 0)
+ {
+ db = itdb_photodb_parse (argv[2], &error);
+ if (db == NULL)
+ {
+ if (error)
+ {
+ g_print (_("Error reading iPod photo database.(%s)\n"), error->message);
+ g_error_free (error);
+ error = NULL;
+ }
+ else
+ g_print (_("Error reading iPod photo database.\n"));
+
+ return 1;
+ }
+ itdb_photodb_rename_photoalbum( db, argv[3], argv[4] );
+ g_print (_("Writing to the photo database.\n"));
+ itdb_photodb_write (db, &error);
+ g_print (_("Freeing the photo database.\n"));
+ itdb_photodb_free (db);
+ }
else
{
db = itdb_photodb_parse (argv[1], &error);