diff options
author | waker <wakeroid@gmail.com> | 2009-09-01 19:18:12 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2009-09-01 19:18:12 +0200 |
commit | 5a19b2184c4cb9fdc0c001152d3a68dec6c31ac7 (patch) | |
tree | 1af795c274916462d1cd9d97c728fc52d415dd25 /plugins | |
parent | 976156b1e9546c28d0b58f7f16a4a5f4a2762fa2 (diff) |
fixed couple lastfm problems
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/lastfm/lastfm.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/lastfm/lastfm.c b/plugins/lastfm/lastfm.c index a88e310d..894ae229 100644 --- a/plugins/lastfm/lastfm.c +++ b/plugins/lastfm/lastfm.c @@ -216,6 +216,11 @@ auth (void) { fprintf (stderr, "obtained scrobbler submission url: %s\n", lfm_submission_url); p = end; } + else { + // send failed, but that doesn't mean session is invalid + curl_req_cleanup (); + return -1; + } curl_req_cleanup (); return 0; @@ -237,7 +242,7 @@ lfm_fetch_song_info (DB_playItem_t *song, const char **a, const char **t, const } *b = deadbeef->pl_find_meta (song, "album"); if (!*b) { - return -1; + *b = ""; } *l = song->duration; *n = deadbeef->pl_find_meta (song, "track"); @@ -428,7 +433,7 @@ lastfm_songfinished (DB_event_song_t *ev, uintptr_t data) { if (!deadbeef->pl_find_meta (ev->song, "artist") || !deadbeef->pl_find_meta (ev->song, "title") - || !deadbeef->pl_find_meta (ev->song, "album") +// || !deadbeef->pl_find_meta (ev->song, "album") ) { return 0; } @@ -463,7 +468,9 @@ lfm_send_nowplaying (void) { if (!status) { if (strncmp (lfm_reply, "OK", 2)) { fprintf (stderr, "nowplaying failed, response:\n%s\n", lfm_reply); - lfm_sess[0] = 0; + if (!strncmp (lfm_reply, "BADSESS", 7)) { + lfm_sess[0] = 0; + } } else { fprintf (stderr, "nowplaying success! response:\n%s\n", lfm_reply); |