-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multi-track queueing #95
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks! Some code style suggestions.
smudge-track.el
Outdated
@@ -303,12 +303,33 @@ Default to sortin tracks by number when listing the tracks from an album." | |||
(defun smudge-track-add-to-queue () | |||
"Add the track under the cursor to the queue." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update docstring to reflect change in functionality.
smudge-track.el
Outdated
(setq track-id (smudge-api-get-item-uri selected-track)) | ||
(setq tracks (cons track-id tracks)) | ||
(forward-line 1)) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid closing parens in new lines.
smudge-track.el
Outdated
(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. | ||
)) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid closing parens in new lines.
Maybe moving the comments to the line before, like you did in line 306-307?
smudge-api.el
Outdated
(lambda (_) | ||
(smudge-api-queue-add-tracks (cdr track-ids) callback))) | ||
(when callback(funcall callback)) | ||
)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid closing parens in new lines.
smudge-api.el
Outdated
(car track-ids) | ||
(lambda (_) | ||
(smudge-api-queue-add-tracks (cdr track-ids) callback))) | ||
(when callback(funcall callback)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add space between args.
(when callback(funcall callback)) | |
(when callback (funcall callback)) |
Hey, thanks for the feedback, I adapted your suggestions. |
Thanks! |
I recently found myself adding multiple tracks at the same time to the queue, with the current implementation I submitted in #93, this results in manually having to go over every track in the list.
With this PR, I'd like to extend the queue functionality to allow the user to add a selection of tracks inside the active region to the queue.
When no mark is set, it defaults to just adding the track under the cursor to the queue.