Skip to content

Commit

Permalink
Fix playlists (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcraigk authored Sep 20, 2023
1 parent 6a27d7a commit a178baf
Show file tree
Hide file tree
Showing 15 changed files with 180 additions and 180 deletions.
10 changes: 5 additions & 5 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 1000`
# on 2023-07-28 20:36:01 UTC using RuboCop version 1.55.0.
# on 2023-09-20 00:10:58 UTC using RuboCop version 1.56.3.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -13,7 +13,7 @@ Lint/EmptyBlock:
- 'spec/features/playlists_spec.rb'
- 'spec/models/show_spec.rb'

# Offense count: 10
# Offense count: 9
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
Metrics/AbcSize:
Exclude:
Expand All @@ -25,20 +25,20 @@ Metrics/ClassLength:
Exclude:
- 'app/controllers/playlists_controller.rb'

# Offense count: 4
# Offense count: 2
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
Metrics/CyclomaticComplexity:
Exclude:
- 'app/controllers/playlists_controller.rb'

# Offense count: 8
# Offense count: 7
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Exclude:
- 'app/controllers/playlists_controller.rb'
- 'spec/support/feature_helpers.rb'

# Offense count: 4
# Offense count: 2
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
Metrics/PerceivedComplexity:
Exclude:
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,11 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.18.0)
rubocop-capybara (2.19.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.23.1)
rubocop-factory_bot (2.24.0)
rubocop (~> 1.33)
rubocop-performance (1.19.0)
rubocop-performance (1.19.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.21.1)
Expand Down Expand Up @@ -384,7 +384,7 @@ GEM
waveformjson (0.1.0)
ruby-audio
webrick (1.8.1)
websocket (1.2.9)
websocket (1.2.10)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/classes/player.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class @Player
setCurrentPlaylist: (track_id) ->
$.ajax
type: 'post'
url: '/reset-playlist'
url: '/override-playlist'
data: { 'track_id': track_id }
success: (r) =>
@playlist = r.playlist
Expand Down
9 changes: 5 additions & 4 deletions app/assets/javascripts/classes/playlist.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class @Playlist
$('#active_playlist').sortable({
placeholder: "ui-state-highlight",
update: =>
this.updatePlaylist 'Track moved in playlist'
this.updatePlaylist()
})

updatePlaylist: (success_msg) ->
Expand All @@ -28,7 +28,7 @@ class @Playlist
$(this).find('.position_num').html "#{idx+1}"
)
$.ajax({
url: '/update-current-playlist',
url: '/reposition-playlist',
type: 'post',
data: { 'track_ids': track_ids },
success: (r) =>
Expand Down Expand Up @@ -114,7 +114,7 @@ class @Playlist
$('#playlist_title').html '(Untitled Playlist)'
this._updatePlaylistStats()
$('#empty_playlist_msg').show()
unless supress_feedback then @Util.feedback { notice: 'Actve Playlist is now empty' }
unless supress_feedback then @Util.feedback { notice: 'Actve playlist is now empty' }
})

bookmarkPlaylist: ->
Expand Down Expand Up @@ -144,6 +144,7 @@ class @Playlist
handleSaveModal: ->
if name = $('#playlist_data').attr 'data-name'
@$save_action_existing.attr 'disabled', false
@$save_action_existing.attr 'selected', true
@$playlist_name_input.val name
@$playlist_slug_input.val $('#playlist_data').attr 'data-slug'
else
Expand Down Expand Up @@ -200,7 +201,7 @@ class @Playlist

_getPlaylist: ->
$.ajax({
url: '/get-playlist',
url: '/load-playlist',
success: (r) =>
if r.playlist && r.playlist.length > 0
$('#empty_playlist_msg').hide()
Expand Down
4 changes: 3 additions & 1 deletion app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,8 @@ html {
#playlist_mode_notice {
display: none;
position: absolute;
left: 66px;
width: 170px;
left: 756px;
top: 86px;
border-radius: 5px;
background-color: #d0f7d0;
Expand All @@ -675,6 +676,7 @@ html {
font-size: 16px;
text-align: center;
padding: 3px;
font-weight: bold;
}
#logo {
position: absolute;
Expand Down
Loading

0 comments on commit a178baf

Please sign in to comment.