Skip to content

Playlist Manipulation: Adding tracks to playlists#198

Closed
martingoe wants to merge 7 commits intojpochyla:masterfrom
martingoe:track-playlist-adding
Closed

Playlist Manipulation: Adding tracks to playlists#198
martingoe wants to merge 7 commits intojpochyla:masterfrom
martingoe:track-playlist-adding

Conversation

@martingoe
Copy link
Copy Markdown
Contributor

@martingoe martingoe commented Oct 14, 2021

As described in the commits, this PR is not quite ready to merge with the main project.

I believe the following problems should be discussed:
Commit 4294be7:

  • The current command executor for adding a track to a playlist is in the playlists list_widget function. This might not be the optimal position.
  • If the request failed, the user should be notified. I believe this could be done with an alert box, but I did not currently find a way to implement this.

Commit 8efb405:

  • The UI should be able to have access to the current user's ID without an API call.

Commit a43611e uses Vecs instead of the more commonly used Vector.

edit: I was unaware of the draft feature github has but I believe this works just as well.

While it is possible to add multiple tracks, I decided to use the simple case of adding one track in this case.
If one wanted to change this to support multiple track_uris, they can simply be passed as CSVs as described in the documentation.
The PublicUser data is sent when returning the current playlists and must be used to identify the owned playlists.
There are two things I see that could be changed:
- The current command executor is in the playlists list_widget function. This might not be the optimal position.
- If the request failed, the user should be notified. I believe this could be done with an alert box, but I did not currently find a way to implement this.
This function implements a way to find the playlists that the user owns and hence can change.
There is one thing I see that could be changed:
- The current function returns a `Vec` while the `Vector` is often used in this application. I was unsure if the vec should be cast to a vector but decided against it. However, the change is relatively simple.
If possible, this should be changed to get the current user's id without an api call.
@jacksongoode
Copy link
Copy Markdown
Collaborator

I agree with @martingoe that an alert box would be essential - not just for this PR but for more transparency in general with failed API calls. I imagine it would be a bar that appears above the seek bar.

Does this PR include a method of removing tracks as well?

@martingoe
Copy link
Copy Markdown
Contributor Author

No, this PR does not include a way to remove a track from a playlist. With that being said, I did experiment with it and do have an implementation. I did not include it in this PR because I wanted it to focus on one feature.

@jpochyla
Copy link
Copy Markdown
Owner

Hi @martingoe, thanks a lot for your interest and for the PR! I finally have some more time so we can finish this. I'll push some more commits into the branch of this PR if that's fine with you.

@martingoe
Copy link
Copy Markdown
Contributor Author

Of course, go ahead.
Unfortunately, I do have some busy weeks ahead myself so things might take a bit longer.

@jpochyla
Copy link
Copy Markdown
Owner

jpochyla commented Nov 30, 2021

I've added support for very simple error alerts in 731dadd (in master).

@jpochyla
Copy link
Copy Markdown
Owner

OK, so I've made some changes in a separate branch and merged to master, so far without the error alerts. Thanks a lot @martingoe and @jacksongoode.

@jpochyla jpochyla closed this Nov 30, 2021
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.

3 participants