-
Notifications
You must be signed in to change notification settings - Fork 142
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
Delete from server button #1004
Conversation
🧐 |
Im bad at writing these things :d |
@flloschy take a look at This is the best spot to implement the deletability checks. As for the download button itself, you've re-implemented the local part of it, which you can find here: The delete button only shows up once you've actually downloaded a track, naturally. So try doing that first. A track can only be deleted if it was downloaded directly, and not as part of an album. If it is part of a downloaded album/artist/playlist, the menu will only show the "lock" button, which will separately mark the track as required for downloading. This means that even if the album is deleted, the track will stay downloaded until explicitly deleted. Deleting a track from the download system then works like this: var item = DownloadStub.fromItem(
type: DownloadItemType.song, item: widget.item);
unawaited(downloadsService.deleteDownload(stub: item)); |
Also, you could try to (conditionally) extend the existing confirmation dialog with additional buttons instead of creating a new widget. That would also help staying consistent with the background colors and such ^^ |
Thats kinda what I did in lib/components/confirm_prompt_dialog_with_actions.dart |
Ohhhhhhhhh there is already a delete from device button which only shows up when a track is separately downloaded... So that makes things easier easier for me xd |
I updated the already existing delete button to adapt to the 2 deletion types: server and client If only one of the two is possible its reflected in the button icon and label, and I added the confirm dialog which was missing previously If its both the name is more generic with just "Delete", when pressed the user will be ask if they want to delete from Server, Client or both, when clicked it will ask one more time to verify the deletion So I think thats all. If there is nothing more major i will add the translations, clean up a bit and format |
Let's keep the server delete separate please. It shouldn't be as common as deleting a download. The prompt was meant as a way to say "hey, are you sure you don't just want to remove the download?" instead of "here are your options, choose whichever you like". I even thought about a separate setting that controls if deleting from the server is possible at all, which defaults to false. So just leave the existing button like it was, and add a separate buttom for deleting from the server :) |
I added a delete-button to the context menu of the album and playlist. @flloschy and I thought it was a good idea to put this in the same PR. |
TIL you can collaborate on a PR xD |
I gave F4 permission to push to my fork thats why he could contribute haha Thought since this uses similar code it fits in here perfectly :) |
@Chaphasilor I think having the delete option there is pretty useful. If you want to delete multiple Album/Playlists you don't have tap on them first and then delete them. Maybe you could also create an batch/multi select feature in the future. Personally I think deleting should be possible, both in the list of all albums and at the album screen. Also Playlists renaming and reordering etc would be awesome :) |
Okay, if it really uses the same endpoint then let's include this in the PR. Do you know if this will only delete the playlist, or also the tracks within the playlist (e.g. if the playlist was automatically created from a directory + m3u file on the file system)? |
@F-4Dev has a problem with his part where the delete button only appears the second time the context menu opens after changing the settings. The confirm dialog is missing, reloading of album/playlist view after deleting and a way to delete albums/playlists in their respective "full screen" view. I believe my additions are done as far as i can tell, though id like to remove some duplicate code after everything seams to be ready. I could also help out a bit more but im scared of merge issues when we both work on something in parallel xd |
@flloschy if you have time to spare you could also open a new PR and work on a separate issue there! 😁 |
Anything particular in mind? |
Nothing particular, pick your poison. |
Since we're getting close to finalizing this, please fix the merge conflicts when pushing the other commits :) |
Okay so, final big thing to do (i believe) is the reload when deleting from the album full screen view (works with the context menu inside the list itself). |
Reloading the list of albums, right? What about refreshing the album when deleting a single track, does that work? |
Yes reloading works when deleting a single item inside the list, not the full screen view |
technically also refreshes the album if the delete dialog was canceled, but this has no effect and there was no easy way to avoid this
okay, it took a while to finish this one up, but everything looks good now! this will be included in the next beta release. |
Thanks to both of you for contributing this! <3 |
You'll need to clear storage first, since the Hive IDs werw shuffled around since the last version you had installed :) |
Ohh yeah makes sense! |
The equivalent of |
found it, its |
Appears to work correctly |
A delete button to remove tracks form the servers filesystem/library
Request from #758