sqlite3_stmt *sql_stmt = NULL;
char *sql = NULL;
- media_svc_retvm_if(album == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "album is NULL");
-
- if (artist)
- sql = sqlite3_mprintf("SELECT album_id FROM %s WHERE name=%Q AND artist=%Q", DB_TABLE_ALBUM, album, artist);
- else
- sql = sqlite3_mprintf("SELECT album_id FROM %s WHERE name=%Q AND artist IS NULL", DB_TABLE_ALBUM, album);
+ media_svc_retvm_if(!album, MS_MEDIA_ERR_INVALID_PARAMETER, "album is NULL");
+ media_svc_retvm_if(!artist, MS_MEDIA_ERR_INVALID_PARAMETER, "artist is NULL");
+ sql = sqlite3_mprintf("SELECT album_id FROM %s WHERE name=%Q AND artist=%Q", DB_TABLE_ALBUM, album, artist);
ret = _media_svc_sql_prepare_to_step(handle, sql, &sql_stmt);
-
if (ret != MS_MEDIA_ERR_NONE) {
if (ret == MS_MEDIA_ERR_DB_NO_RECORD)
media_svc_debug("there is no album.");
else
- media_svc_error("error when _media_svc_get_album_id. err = [%d]", ret);
+ media_svc_error("failed to get album id[%d]", ret);
return ret;
}