summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJorg Schuler <jcsjcs@users.sourceforge.net>2005-09-23 16:59:34 +0000
committerJorg Schuler <jcsjcs@users.sourceforge.net>2005-09-23 16:59:34 +0000
commite89c06607a5763356e0d11e3871b2a3f1e444a94 (patch)
treea84a90286df174cf677f23de8767dbd6c7d90093 /tests
parent4736ad7ce4ec22c710d1519b2d80b972de9774b8 (diff)
downloadlibgpod-tmz-e89c06607a5763356e0d11e3871b2a3f1e444a94.tar.gz
libgpod-tmz-e89c06607a5763356e0d11e3871b2a3f1e444a94.tar.xz
libgpod-tmz-e89c06607a5763356e0d11e3871b2a3f1e444a94.zip
* bindings/: added python bindings provided by Nicholas Piper
<nick at nickpiper co uk> * itdb.h: added enum ItdbPlFlag and Itdb_Playlist->podcastflag field. * itdb.h/itdb_itunesdb.c: added time_released field * itdb_itunesdb.c: rewrote write_playlist() for easier maintenance. * itdb_itunesdb.c: read/write support for podcast playlists including chapterdata (but only in raw format) git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1100 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'tests')
-rw-r--r--tests/itdb_main.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/tests/itdb_main.c b/tests/itdb_main.c
index 2178af3..e7723bb 100644
--- a/tests/itdb_main.c
+++ b/tests/itdb_main.c
@@ -45,19 +45,23 @@ main (int argc, char *argv[])
{
GError *error=NULL;
Itdb_iTunesDB *itdb;
+ gchar *infile = NULL;
+ gchar *outfile = NULL;
-#ifdef ENABLE_NLS
- bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-#endif
+ if (argc >= 2)
+ infile = argv[1];
+ if (argc >= 3)
+ outfile = argv[2];
- if (argc == 2)
- itdb = itdb_parse_file (argv[1], &error);
- else itdb = itdb_parse_file ("/home/jcs/.gtkpod/iTunesDB20050102",
- &error);
+ if (infile == 0)
+ {
+ printf ("Usage: %s <infile> [<outfile>]\n", g_basename(argv[0]));
+ exit (0);
+ }
+ itdb = itdb_parse_file (infile, &error);
printf ("%p\n", itdb);
+
if (error)
{
if (error->message)
@@ -71,7 +75,8 @@ main (int argc, char *argv[])
printf ("tracks: %d\n", g_list_length (itdb->tracks));
printf ("playlists: %d\n", g_list_length (itdb->playlists));
- itdb_write_file (itdb, "/home/jcs/.gtkpod/iTunesDB", &error);
+ if (outfile)
+ itdb_write_file (itdb, outfile, &error);
if (error)
{
if (error->message)
@@ -83,6 +88,5 @@ main (int argc, char *argv[])
itdb_free (itdb);
- /* all the cleanup is already done in gtkpod_main_quit() in misc.c */
return 0;
}