comparison src/scrobbler/plugin.c @ 1443:f4d8082668c1

scrobbler: tuple API update
author William Pitcock <nenolod@atheme-project.org>
date Fri, 10 Aug 2007 10:03:10 -0500
parents 761e17b23e0c
children 16044c4a34d7 d158ce84fda7
comparison
equal deleted inserted replaced
1442:95b8abed24c7 1443:f4d8082668c1
213 static void *xs_thread(void *data __attribute__((unused))) 213 static void *xs_thread(void *data __attribute__((unused)))
214 { 214 {
215 int run = 1; 215 int run = 1;
216 216
217 while (run) { 217 while (run) {
218 TitleInput *tuple; 218 Tuple *tuple;
219 GTimeVal sleeptime; 219 GTimeVal sleeptime;
220 220
221 /* Error catching */ 221 /* Error catching */
222 if(sc_catch_error()) 222 if(sc_catch_error())
223 { 223 {
241 tuple = playlist_get_tuple(playlist, playlist_get_position(playlist)); 241 tuple = playlist_get_tuple(playlist, playlist_get_position(playlist));
242 242
243 if (tuple == NULL) 243 if (tuple == NULL)
244 continue; 244 continue;
245 245
246 if (ishttp(tuple->file_name)) 246 if (ishttp(tuple_get_string(tuple, "file-name")))
247 continue; 247 continue;
248 248
249 if(tuple->performer != NULL && tuple->track_name != NULL) 249 if(tuple_get_string(tuple, "artist") != NULL && tuple_get_string(tuple, "title") != NULL)
250 { 250 {
251 pdebug(fmt_vastr( 251 pdebug(fmt_vastr(
252 "submitting artist: %s, title: %s", 252 "submitting artist: %s, title: %s",
253 tuple->performer, tuple->track_name), DEBUG); 253 tuple_get_string(tuple, "artist"), tuple_get_string(tuple, "title")), DEBUG);
254 sc_addentry(m_scrobbler, tuple, tuple->length / 1000); 254 sc_addentry(m_scrobbler, tuple, tuple_get_int(tuple, "length") / 1000);
255 gerpok_sc_addentry(m_scrobbler, tuple, tuple->length / 1000); 255 gerpok_sc_addentry(m_scrobbler, tuple, tuple_get_int(tuple, "length") / 1000);
256 } 256 }
257 else 257 else
258 pdebug("tuple does not contain an artist or a title, not submitting.", DEBUG); 258 pdebug("tuple does not contain an artist or a title, not submitting.", DEBUG);
259 259
260 submit = FALSE; 260 submit = FALSE;