Mercurial > audlegacy
comparison Plugins/General/scrobbler/xmms_scrobbler.c @ 1236:fc478bfe6fe6 trunk
[svn] - disconnect the scrobbler client from metatag logically
author | nenolod |
---|---|
date | Wed, 14 Jun 2006 22:30:04 -0700 |
parents | 22707aa5ea6f |
children | 8a2d526864c2 |
comparison
equal
deleted
inserted
replaced
1235:7918849bad3e | 1236:fc478bfe6fe6 |
---|---|
6 #include <gdk/gdkkeysyms.h> | 6 #include <gdk/gdkkeysyms.h> |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <audacious/plugin.h> | 9 #include <audacious/plugin.h> |
10 #include <audacious/prefswin.h> | 10 #include <audacious/prefswin.h> |
11 #include <audacious/playlist.h> | |
11 #include <libaudacious/configdb.h> | 12 #include <libaudacious/configdb.h> |
12 #include <libaudacious/beepctrl.h> | 13 #include <libaudacious/beepctrl.h> |
13 | 14 |
14 #include <unistd.h> | 15 #include <unistd.h> |
15 #include <stdio.h> | 16 #include <stdio.h> |
365 return dosubmit; | 366 return dosubmit; |
366 } | 367 } |
367 | 368 |
368 static void *xs_thread(void *data __attribute__((unused))) | 369 static void *xs_thread(void *data __attribute__((unused))) |
369 { | 370 { |
370 int run = 1, i; | 371 int run = 1; |
372 #if 0 | |
373 int i; | |
371 char *charpos, *dirname; | 374 char *charpos, *dirname; |
372 gboolean direxists; | 375 gboolean direxists; |
376 #endif | |
373 submit_t dosubmit; | 377 submit_t dosubmit; |
374 | 378 |
375 while (run) { | 379 while (run) { |
376 /* Error catching */ | 380 /* Error catching */ |
377 if(sc_catch_error()) | 381 if(sc_catch_error()) |
382 | 386 |
383 /* Check for ability to submit */ | 387 /* Check for ability to submit */ |
384 dosubmit = get_song_status(); | 388 dosubmit = get_song_status(); |
385 | 389 |
386 if(dosubmit.dosubmit) { | 390 if(dosubmit.dosubmit) { |
391 #if 0 | |
387 char *fname, /**title, *artist,*/ *tmp = NULL; /**sep*/ | 392 char *fname, /**title, *artist,*/ *tmp = NULL; /**sep*/ |
388 int track = 0; | 393 int track = 0; |
389 metatag_t *meta; | 394 metatag_t *meta; |
395 #endif | |
396 TitleInput *tuple; | |
390 | 397 |
391 pdebug("Submitting song.", DEBUG); | 398 pdebug("Submitting song.", DEBUG); |
392 | 399 |
400 tuple = playlist_get_tuple(dosubmit.pos_c); | |
401 | |
402 if (ishttp(tuple->file_name)) | |
403 continue; | |
404 | |
405 if(tuple->performer != NULL && tuple->track_name != NULL) | |
406 { | |
407 pdebug(fmt_vastr( | |
408 "submitting artist: %s, title: %s", | |
409 tuple->performer, tuple->track_name), DEBUG); | |
410 sc_addentry(m_scrobbler, tuple, | |
411 dosubmit.len/1000); | |
412 } | |
413 else | |
414 pdebug("tuple does not contain an artist or a title, not submitting.", DEBUG); | |
415 #if 0 | |
393 meta = metatag_new(); | 416 meta = metatag_new(); |
394 | 417 |
395 fname = xmms_remote_get_playlist_file(0,dosubmit.pos_c); | 418 fname = xmms_remote_get_playlist_file(0,dosubmit.pos_c); |
396 if (ishttp(fname)) { | 419 if (ishttp(fname)) { |
397 g_free(fname); | 420 g_free(fname); |
467 "title, not submitting", | 490 "title, not submitting", |
468 DEBUG); | 491 DEBUG); |
469 /* g_free(tmp); */ | 492 /* g_free(tmp); */ |
470 g_free(fname); | 493 g_free(fname); |
471 metatag_delete(meta); | 494 metatag_delete(meta); |
495 #endif | |
472 } | 496 } |
473 g_mutex_lock(m_scrobbler); | 497 g_mutex_lock(m_scrobbler); |
474 run = going; | 498 run = going; |
475 g_mutex_unlock(m_scrobbler); | 499 g_mutex_unlock(m_scrobbler); |
476 usleep(100000); | 500 usleep(100000); |