# HG changeset patch # User Matti Hamalainen # Date 1189369372 -10800 # Node ID 1ac047826c64b642e29b9a60e5eea87c036cf729 # Parent c306cdaf648cc00067f6307f6ebe8788a518147d Fix some tuple function calls to conform with new API. diff -r c306cdaf648c -r 1ac047826c64 src/mtp_up/mtp.c --- a/src/mtp_up/mtp.c Sun Sep 09 05:44:18 2007 +0300 +++ b/src/mtp_up/mtp.c Sun Sep 09 23:22:52 2007 +0300 @@ -135,7 +135,7 @@ uint32_t parent_id = 0; struct stat sb; - from_path = g_strdup_printf("%s/%s", tuple_get_string(from_tuple, "file-path"), tuple_get_string(from_tuple, "file-name")); + from_path = g_strdup_printf("%s/%s", tuple_get_string(from_tuple, FIELD_FILE_PATH, NULL), tuple_get_string(from_tuple, FIELD_FILE_NAME)); gchar *tmp; tmp = g_strescape(from_path,NULL); filename=g_filename_from_uri(tmp,NULL,NULL); @@ -162,15 +162,15 @@ /* track metadata*/ tr = LIBMTP_new_track_t(); - tr->title =g_strdup((gchar*) tuple_get_string(from_tuple, "title")); - tr->artist =g_strdup((gchar*) tuple_get_string(from_tuple,"artist")); - tr->album = g_strdup((gchar*)tuple_get_string(from_tuple,"album")); + tr->title = g_strdup((gchar*) tuple_get_string(from_tuple, FIELD_TITLE, NULL)); + tr->artist = g_strdup((gchar*) tuple_get_string(from_tuple, FIELD_ARTIST, NULL)); + tr->album = g_strdup((gchar*)tuple_get_string(from_tuple, FIELD_ALBUM, NULL)); tr->filesize = filesize; - tr->filename = g_strdup(tuple_get_string(from_tuple, "file-name")); - tr->duration = (uint32_t)tuple_get_int(from_tuple, "length"); + tr->filename = g_strdup(tuple_get_string(from_tuple, FIELD_FILE_NAME, NULL)); + tr->duration = (uint32_t)tuple_get_int(from_tuple, FIELD_LENGTH, NULL); tr->filetype = find_filetype (from_path); - tr->genre = g_strdup((gchar*)tuple_get_string(from_tuple, "genre")); - tr->date = g_strdup_printf("%d",tuple_get_int(from_tuple, "year")); + tr->genre = g_strdup((gchar*)tuple_get_string(from_tuple, FIELD_GENRE, NULL)); + tr->date = g_strdup_printf("%d",tuple_get_int(from_tuple, FIELD_YEAR, NULL)); g_free(filename); g_free(from_path); g_free(tmp); @@ -184,7 +184,7 @@ uint32_t parent_id = 0; LIBMTP_track_t *gentrack; gentrack = track_metadata(from_tuple); - from_path = g_strdup_printf("%s/%s", tuple_get_string(from_tuple, "file-path"), tuple_get_string(from_tuple, "file-name")); + from_path = g_strdup_printf("%s/%s", tuple_get_string(from_tuple, FIELD_FILE_PATH, NULL), tuple_get_string(from_tuple, FIELD_FILE_NAME, NULL)); if(gentrack == NULL) return 1; comp = g_strescape(from_path,NULL); g_free(from_path); diff -r c306cdaf648c -r 1ac047826c64 src/wav/wav.c --- a/src/wav/wav.c Sun Sep 09 05:44:18 2007 +0300 +++ b/src/wav/wav.c Sun Sep 09 23:22:52 2007 +0300 @@ -193,14 +193,14 @@ tuple = tuple_new_from_filename(filename); - tuple_associate_string(tuple, "codec", "RIFF/WAV Audio (ADPCM)"); - tuple_associate_string(tuple, "quality", "lossless"); + tuple_associate_string(tuple, FIELD_CODEC, NULL, "RIFF/WAV Audio (ADPCM)"); + tuple_associate_string(tuple, FIELD_QUALITY, NULL, "lossless"); title = tuple_formatter_make_title_string(tuple, get_gentitle_format()); if (*title == '\0') { g_free(title); - title = g_strdup(tuple_get_string(tuple, "file-name")); + title = g_strdup(tuple_get_string(tuple, FIELD_FILE_NAME, NULL)); } tuple_free(tuple);