Skip to content

Commit

Permalink
find playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Nov 19, 2024
1 parent 3386981 commit a80608a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/controllers/playlists_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ def index
def show
if current_user
begin
@playlist = current_user.playlists.friendly.find(params[:id])
@playlist = Playlist.where(user_id: current_user.id)
.or(Playlist.where(label_id: current_user.id))
.where(playlist_type: ["album", "ep"])
.friendly.find(params[:id])
rescue ActiveRecord::RecordNotFound
nil
end
Expand Down

0 comments on commit a80608a

Please sign in to comment.