summaryrefslogtreecommitdiffstats
path: root/src/db-artwork-parser.c
diff options
context:
space:
mode:
authorJorg Schuler <jcsjcs@users.sourceforge.net>2007-04-27 14:09:59 +0000
committerJorg Schuler <jcsjcs@users.sourceforge.net>2007-04-27 14:09:59 +0000
commit4e34b34b9c9ea5df23548c86da080b700666f00f (patch)
tree3edd7b23d5848a943cfaa9a177800fc8f94f44e4 /src/db-artwork-parser.c
parent0a8bf8b3ac053452aab77d6842b4f7ae475419e4 (diff)
downloadlibgpod-4e34b34b9c9ea5df23548c86da080b700666f00f.tar.gz
libgpod-4e34b34b9c9ea5df23548c86da080b700666f00f.tar.xz
libgpod-4e34b34b9c9ea5df23548c86da080b700666f00f.zip
* docs/reference/tmpl/device.sgml
docs/reference/tmpl/itunesdb-time.sgml docs/reference/tmpl/libgpod-unused.sgml docs/reference/tmpl/track.sgml src/db-artwork-parser.c src/db-artwork-writer.c src/db-itunes-parser.h src/itdb.h src/itdb_device.c src/itdb_device.h src/itdb_itunesdb.c src/itdb_private.h tests/Makefile.am: Christophe's patch for automatic correction of timestamps depending on which timezone the iPod is set to. ATTENTION DEVELOPERS: as a consequence all exported timestamps are no longer guint32 mac-type timestamps but standard time_t timestamps. This also includes the 64 bit timestamps in smart playlists. The following functions are therefore no longer needed and are deprecated: itdb_time_mac_to_host(), itdb_time_host_to_mac(): simply return the argument without changing it. Argument and return value are now both of type 'time_t'. itunesdb_time_get_mac_time(): returns the seconds passed since Epoch in seconds and is equivalent to time(NULL). These functions may be removed in a future version of libgpod. Programs linking to libgpod may need to be changed slightly if they made any assumptions on the type of timestamps used. This should be obvious through compile-time warnings. tests/test-ls.c: print a list of recently played tracks. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1417 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'src/db-artwork-parser.c')
-rw-r--r--src/db-artwork-parser.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/db-artwork-parser.c b/src/db-artwork-parser.c
index ecb4ce1..5474458 100644
--- a/src/db-artwork-parser.c
+++ b/src/db-artwork-parser.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 Christophe Fergeau
+ * Copyright (C) 2005-2007 Christophe Fergeau
*
*
* The code contained in this file is free software; you can redistribute
@@ -237,6 +237,8 @@ parse_mhii (DBParseContext *ctx, GError *error)
Itdb_PhotoDB *photodb;
Itdb_iTunesDB *itunesdb;
guint64 dbid;
+ guint64 mactime;
+ Itdb_iTunesDB *itdb = db_get_itunesdb (ctx->db);
mhii = db_parse_context_get_m_header (ctx, MhiiHeader, "mhii");
if (mhii == NULL)
@@ -277,11 +279,11 @@ parse_mhii (DBParseContext *ctx, GError *error)
artwork->unk028 = get_gint32 (mhii->unknown4, ctx->byte_order);
artwork->rating = get_gint32 (mhii->rating, ctx->byte_order);
artwork->unk036 = get_gint32 (mhii->unknown6, ctx->byte_order);
- artwork->creation_date = get_gint32 (mhii->orig_date, ctx->byte_order);
- artwork->digitized_date = get_gint32 (mhii->digitized_date,
- ctx->byte_order);
- artwork->artwork_size = get_gint32 (mhii->orig_img_size,
- ctx->byte_order);
+ mactime = get_gint32 (mhii->orig_date, ctx->byte_order);
+ artwork->creation_date = itdb_time_mac_to_time_t (itdb, mactime);
+ mactime = get_gint32 (mhii->digitized_date, ctx->byte_order);
+ artwork->digitized_date = itdb_time_mac_to_time_t (itdb, mactime);
+ artwork->artwork_size = get_gint32 (mhii->orig_img_size, ctx->byte_order);
if (song)
{