Skip to content
Browse files

Whitespace.

  • Loading branch information...
1 parent 9acfe38 commit 0228f1dd6c300a8d067ba7a9effe71f8717e6bf5 @smashwilson committed Aug 10, 2012
Showing with 7 additions and 7 deletions.
  1. +7 −7 app/controllers/playlists_controller.rb
View
14 app/controllers/playlists_controller.rb
@@ -9,7 +9,7 @@ def show
# Reorder the tracks within the playlist.
def update
@playlist = EnqueuedTrack.playlist
-
+
EnqueuedTrack.transaction do
@playlist.each do |enqueued|
enqueued.position = params[:enqueued_track].index(enqueued.id.to_s) + 1
@@ -24,24 +24,24 @@ def update
def enqueue
track = Track.find params[:id]
e = EnqueuedTrack.enqueue track
-
+
unless e.valid?
render :status => 500, :text => "Unable to enqueue track: #{e.errors.full_messages.join ' '}", :content_type => 'text/plain'
return
end
render :text => "#{track} has been added to the playlist.", :content_type => 'text/plain'
end
-
+
def enqueue_all
tracks = Track.find params[:ids]
es = EnqueuedTrack.enqueue_all tracks
-
+
unless es.all? { |e| e.valid? }
summary = es.inject('') { |e,text| "#{text} #{e.errors.full_messages.join ' '}" }
render :status => 500, :text => "Unable to enqueue tracks: #{summary}", :content_type => 'text/plain'
end
-
+
render :text => "#{tracks.size} tracks have been added to the playlist.", :content_type => 'text/plain'
end
@@ -52,9 +52,9 @@ def dequeue
render :status => 404, :text => "Track (#{params[:id]}) not found", :content_type => 'text/plain'
return
end
-
+
e.delete
-
+
render :text => "#{e.track} has been removed from the playlist.", :content_type => 'text/plain'
end

0 comments on commit 0228f1d

Please sign in to comment.
Something went wrong with that request. Please try again.