Scrobble and length fix
This commit is contained in:
@@ -94,7 +94,7 @@ class ArtistController < ApplicationController
|
||||
tmp_album = {:id => album.id, :name => album.name, :year => album.year, :pic => album.pic_url, :tracks => []}
|
||||
album.tracks.each do |track|
|
||||
tmp_track = {id: track.id, name: track.name, live: track.live, acoustic: track.acoustic}
|
||||
tmp_track[:length] = (track.length / 1000).round unless track.length.nil?
|
||||
tmp_track[:length] = track.length unless track.length.nil?
|
||||
tmp_track[:duration] = formatTrackDuration(track.length)
|
||||
tmp_track[:position] = track.position.to_s 36
|
||||
# tmp_track[:mbid] = track.mbid
|
||||
|
||||
@@ -59,13 +59,13 @@ class LastFmController < ApplicationController
|
||||
:track => params[:name],
|
||||
:artist => params[:artist],
|
||||
:album => params[:album],
|
||||
:trackNumber => params[:position],
|
||||
:trackNumber => params[:position].to_i,
|
||||
# :mbid => params[:mbid],
|
||||
:duration => params[:length],
|
||||
:duration => params[:length].to_i,
|
||||
:sk => user.lastfm_key # Auth session key
|
||||
)
|
||||
|
||||
render :json => { :status => r['error'].nil? ? 'success' : 'failed' }
|
||||
render :json => { :status => r['error'].nil? ? 'success' : r }
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user