Skip to content

Commit

Permalink
fix convention
Browse files Browse the repository at this point in the history
  • Loading branch information
27justin committed Dec 13, 2023
1 parent 4b73171 commit 7a44b61
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
3 changes: 1 addition & 2 deletions smudge-api.el
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,7 @@ Call CALLBACK if provided."
(car track-ids)
(lambda (_)
(smudge-api-queue-add-tracks (cdr track-ids) callback)))
(when callback(funcall callback))
))
(when callback (funcall callback))))

(provide 'smudge-api)
;;; smudge-api.el ends here
14 changes: 6 additions & 8 deletions smudge-track.el
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,13 @@ Default to sortin tracks by number when listing the tracks from an album."
(message "Cannot remove a track from a playlist from here")))

(defun smudge-track-add-to-queue ()
"Add the track under the cursor to the queue."
"Add the track(s) under the cursor (or inside the active region) to the queue."
(interactive)
;; Check whether the mark is active and if so, queue all the tracks in the
;; region. If not, queue the track under the cursor.
(if (null mark-active)
(let ((selected-track (tabulated-list-get-id)))
(setq track-id (smudge-api-get-item-uri selected-track))
(setq track-id (smudge-api-get-item-uri selected-track))
(smudge-api-queue-add-track
track-id
(lambda(_)
Expand All @@ -321,15 +321,13 @@ Default to sortin tracks by number when listing the tracks from an album."
(setq selected-track (tabulated-list-get-id))
(setq track-id (smudge-api-get-item-uri selected-track))
(setq tracks (cons track-id tracks))
(forward-line 1))
)
(forward-line 1)))
(smudge-api-queue-add-tracks
(reverse tracks)
nil)
(message "Added %d tracks to your queue." (length tracks)) ; Send the message here instead of in the callback
; because the API call has to sequentially add each song which might take some time.
))
)
;; Send the message here instead of in the callback
;; because the API call has to sequentially add each song which might take some time.
(message "Added %d tracks to your queue." (length tracks)))))


(provide 'smudge-track)
Expand Down

0 comments on commit 7a44b61

Please sign in to comment.