Skip to content
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

Merged
merged 3 commits into from
Dec 13, 2023
Merged

Conversation

27justin
Copy link
Contributor

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.

Copy link
Owner

@danielfm danielfm left a 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."
Copy link
Owner

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))
)
Copy link
Owner

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
Comment on lines 329 to 332
(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.
))
)
Copy link
Owner

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))
))
Copy link
Owner

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))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add space between args.

Suggested change
(when callback(funcall callback))
(when callback (funcall callback))

@27justin
Copy link
Contributor Author

Hey, thanks for the feedback, I adapted your suggestions.

@danielfm danielfm self-assigned this Dec 13, 2023
@danielfm
Copy link
Owner

Thanks!

@danielfm danielfm merged commit 43812b7 into danielfm:master Dec 13, 2023
1 check failed
@27justin 27justin deleted the multi-line-queue branch December 14, 2023 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants