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

Cutting Ctrl+X track with missing track files from track sets removes them irretrievably #13100

Open
ronso0 opened this issue Apr 14, 2024 · 2 comments · May be fixed by #13146
Open

Cutting Ctrl+X track with missing track files from track sets removes them irretrievably #13100

ronso0 opened this issue Apr 14, 2024 · 2 comments · May be fixed by #13146
Milestone

Comments

@ronso0
Copy link
Member

ronso0 commented Apr 14, 2024

Bug

If you want to do cut & paste in track sets while track files are missing, you can cut (copy & remove) but you can't paste due to invalid QFileInfos (no location).

This may happen with tracks on currently unmounted drives and will drop tracks irretrievably..

Fix?

Use DragAndDropHelper::supportedTracksFromUrls and check if the number of returned QFileInfos is equal the number of indices. Else block Cut.
This may be costly. We could first check the fs_deleted column and abort if at least one track was deleted.
If no tracks is marked deleted that may be due to an outstanding do the dnd check

Unfortunately we also need a popup:
"Cut is prohibited because one or more track files of the selection is missing"
(opt1: list missing files)
(opt2: "Remove missing tracks from selection and try again" button)

Elaborate, maybe risky alternative:

hybrid copy/paste with QUrls + TrackIds?
is this even possible?


I consider this a blocker since it may wipe user data.

Version

2.5-alpha

OS

No response

@ronso0 ronso0 added the bug label Apr 14, 2024
@ronso0 ronso0 added this to the 2.5-beta milestone Apr 14, 2024
@ronso0 ronso0 added the blocker label Apr 14, 2024
@ronso0 ronso0 changed the title don't allow Cut in track sets if track files are missing Cutting Ctrl+X track with missing track files from track sets removes them irretrievably Apr 16, 2024
@m0dB
Copy link
Contributor

m0dB commented Apr 20, 2024

I am trying to wrap my head around this... Wouldn't it be possible to go directly from url to trackId, without going through fileInfo to avoid this?

@m0dB
Copy link
Contributor

m0dB commented Apr 20, 2024

I tried going from urls to trackIds without going through mixxx::FileInfo (and without calling DragAndDropeHelper::supportedTracksFromUrls)

#13146

This seems to work, but to be honest, I have a hard time understanding all this code and I can't really tell if this is a valid solution or not.

@ronso0 ronso0 linked a pull request Apr 29, 2024 that will close this issue
@m0dB m0dB linked a pull request May 3, 2024 that will close this issue
@daschuer daschuer modified the milestones: 2.5-beta, 2.5.0 May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants