diff options
author | Robert Keevil <rkeevil+rockbox@gmail.com> | 2008-10-07 18:39:44 +0000 |
---|---|---|
committer | Robert Keevil <rkeevil+rockbox@gmail.com> | 2008-10-07 18:39:44 +0000 |
commit | 2c170356f38f5630b9fefdc5b1e7e57babb5cc40 (patch) | |
tree | 9ba565416427f76e6cf4754ef199ed02f804edf6 /apps/scrobbler.c | |
parent | 7eb194477a19a12d76bceb64108ffad2da784c9f (diff) | |
download | rockbox-2c170356f38f5630b9fefdc5b1e7e57babb5cc40.tar.gz rockbox-2c170356f38f5630b9fefdc5b1e7e57babb5cc40.zip |
FS#9139 - support for ver 1.1 scrobbler log files. Upload any old files first - uploading software may need updating, see the LastFMLog wiki page
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18732 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/scrobbler.c')
-rw-r--r-- | apps/scrobbler.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/scrobbler.c b/apps/scrobbler.c index 7af45a0c8f..3b35e0d66a 100644 --- a/apps/scrobbler.c +++ b/apps/scrobbler.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2006 Robert Keevil | 10 | * Copyright (C) 2006-2008 Robert Keevil |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or | 12 | * This program is free software; you can redistribute it and/or |
13 | * modify it under the terms of the GNU General Public License | 13 | * modify it under the terms of the GNU General Public License |
@@ -42,7 +42,7 @@ http://www.audioscrobbler.net/wiki/Portable_Player_Logging | |||
42 | 42 | ||
43 | #include "scrobbler.h" | 43 | #include "scrobbler.h" |
44 | 44 | ||
45 | #define SCROBBLER_VERSION "1.0" | 45 | #define SCROBBLER_VERSION "1.1" |
46 | 46 | ||
47 | #if CONFIG_RTC | 47 | #if CONFIG_RTC |
48 | #define SCROBBLER_FILE "/.scrobbler.log" | 48 | #define SCROBBLER_FILE "/.scrobbler.log" |
@@ -151,24 +151,26 @@ static void add_to_cache(unsigned long play_length) | |||
151 | { | 151 | { |
152 | ret = snprintf(scrobbler_cache+(SCROBBLER_CACHE_LEN*cache_pos), | 152 | ret = snprintf(scrobbler_cache+(SCROBBLER_CACHE_LEN*cache_pos), |
153 | SCROBBLER_CACHE_LEN, | 153 | SCROBBLER_CACHE_LEN, |
154 | "%s\t%s\t%s\t%d\t%d\t%c\t%ld\n", | 154 | "%s\t%s\t%s\t%d\t%d\t%c\t%ld\t%s\n", |
155 | scrobbler_entry.artist, | 155 | scrobbler_entry.artist, |
156 | scrobbler_entry.album?scrobbler_entry.album:"", | 156 | scrobbler_entry.album?scrobbler_entry.album:"", |
157 | scrobbler_entry.title, | 157 | scrobbler_entry.title, |
158 | scrobbler_entry.tracknum, | 158 | scrobbler_entry.tracknum, |
159 | (int)scrobbler_entry.length/1000, | 159 | (int)scrobbler_entry.length/1000, |
160 | rating, | 160 | rating, |
161 | (long)timestamp); | 161 | (long)timestamp, |
162 | scrobbler_entry.mb_track_id?scrobbler_entry.mb_track_id:""); | ||
162 | } else { | 163 | } else { |
163 | ret = snprintf(scrobbler_cache+(SCROBBLER_CACHE_LEN*cache_pos), | 164 | ret = snprintf(scrobbler_cache+(SCROBBLER_CACHE_LEN*cache_pos), |
164 | SCROBBLER_CACHE_LEN, | 165 | SCROBBLER_CACHE_LEN, |
165 | "%s\t%s\t%s\t\t%d\t%c\t%ld\n", | 166 | "%s\t%s\t%s\t\t%d\t%c\t%ld\t%s\n", |
166 | scrobbler_entry.artist, | 167 | scrobbler_entry.artist, |
167 | scrobbler_entry.album?scrobbler_entry.album:"", | 168 | scrobbler_entry.album?scrobbler_entry.album:"", |
168 | scrobbler_entry.title, | 169 | scrobbler_entry.title, |
169 | (int)scrobbler_entry.length/1000, | 170 | (int)scrobbler_entry.length/1000, |
170 | rating, | 171 | rating, |
171 | (long)timestamp); | 172 | (long)timestamp, |
173 | scrobbler_entry.mb_track_id?scrobbler_entry.mb_track_id:""); | ||
172 | } | 174 | } |
173 | 175 | ||
174 | if ( ret >= SCROBBLER_CACHE_LEN ) | 176 | if ( ret >= SCROBBLER_CACHE_LEN ) |