Mercurial > audlegacy-plugins
diff src/mtp_up/mtp.c @ 1696:1ac047826c64
Fix some tuple function calls to conform with new API.
| author | Matti Hamalainen <ccr@tnsp.org> |
|---|---|
| date | Sun, 09 Sep 2007 23:22:52 +0300 |
| parents | 88f5ba93f3dd |
| children | f35f9d6fcb6d |
line wrap: on
line diff
--- 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);
