diff src/scrobbler/plugin.c @ 1687:d158ce84fda7

Modified for Tuplez/plugin API changes.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 05 Sep 2007 09:29:26 +0300
parents f4d8082668c1
children 62e89e392227
line wrap: on
line diff
--- a/src/scrobbler/plugin.c	Wed Sep 05 07:38:21 2007 +0300
+++ b/src/scrobbler/plugin.c	Wed Sep 05 09:29:26 2007 +0300
@@ -243,16 +243,19 @@
 			if (tuple == NULL)
 				continue;
 
-			if (ishttp(tuple_get_string(tuple, "file-name")))
+			if (ishttp(tuple_get_string(tuple, FIELD_FILE_NAME, NULL)))
 				continue;
 
-			if(tuple_get_string(tuple, "artist") != NULL && tuple_get_string(tuple, "title") != NULL)
+			if (tuple_get_string(tuple, FIELD_ARTIST, NULL) != NULL &&
+				tuple_get_string(tuple, FIELD_TITLE, NULL) != NULL)
 			{
 				pdebug(fmt_vastr(
 					"submitting artist: %s, title: %s",
-					tuple_get_string(tuple, "artist"), tuple_get_string(tuple, "title")), DEBUG);
-				sc_addentry(m_scrobbler, tuple, tuple_get_int(tuple, "length") / 1000);
-				gerpok_sc_addentry(m_scrobbler, tuple, tuple_get_int(tuple, "length") / 1000);
+					tuple_get_string(tuple, FIELD_ARTIST, NULL),
+					tuple_get_string(tuple, FIELD_TITLE, NULL)), DEBUG);
+				
+				sc_addentry(m_scrobbler, tuple, tuple_get_int(tuple, FIELD_LENGTH, NULL) / 1000);
+				gerpok_sc_addentry(m_scrobbler, tuple, tuple_get_int(tuple, FIELD_LENGTH, NULL) / 1000);
 			}
 			else
 				pdebug("tuple does not contain an artist or a title, not submitting.", DEBUG);