Skip to content

Implement playlist and crate file export.#849

Merged
ywwg merged 16 commits intomixxxdj:masterfrom
ywwg:export-crate
Jan 20, 2016
Merged

Implement playlist and crate file export.#849
ywwg merged 16 commits intomixxxdj:masterfrom
ywwg:export-crate

Conversation

@ywwg
Copy link
Copy Markdown
Member

@ywwg ywwg commented Jan 9, 2016

This copies all of the tracks in a crate or playlist into a folder such as an external USB stick. Only files are copied, not mixxx-specific metadata like waveforms or cover art that is not embedded in the file.

ywwg added 2 commits January 8, 2016 21:56
This copies all of the tracks in a crate or playlist into a folder,
such as an external USB stick.  Only files are copied, not mixxx-specific
metadata like waveforms or cover art that is not embedded in the file.
@rryan
Copy link
Copy Markdown
Member

rryan commented Jan 9, 2016

Neat! High level comments:

  • File I/O in a loop on the GUI thread -> going to make Mixxx kind of unusable for a while?
  • Progress bar with cancel button would be nice.
  • Might be nice to provide a size estimate "This will take up XXX MB on the destination disk."

@Pegasus-RPG
Copy link
Copy Markdown
Member

Once you have a size estimate, how involved would it be to check to see if the destination file system has enough space? And don't even start the copy if not. (Partial multiple-file copies are a pain to fix so let's avoid them.)

Comment thread src/library/baseplaylistfeature.cpp Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since this is new code, please factor it out now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

what's a good place to put factored-out code like this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

util/soundfileexport.cpp seems sensible

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Or since this is specific to the library, just put it in library/soundfileexport.cpp

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what's a good place to put factored-out code like this?

I think you're going to end up needing a few different components -- a dialog, a thread for doing the work in, some utilities for serializing the Mixxx metadata (once you get to that) and such so maybe library/export/ is a reasonable place to stick code related to this? The LibraryScanner is a similar model.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(probably don't need a threadpool / task thing like the LibraryScanner does though)

@ywwg
Copy link
Copy Markdown
Member Author

ywwg commented Jan 9, 2016

ah yes progress bar will be much nicer than the stupid messagebox I have at the end.

Size estimate is not too hard, but getting remaining disk space is tricky. I'd prefer to just run out of space and have the resulting error pop up.

@ywwg
Copy link
Copy Markdown
Member Author

ywwg commented Jan 16, 2016

closing for now while I do a major refactor

@ywwg ywwg closed this Jan 16, 2016
@ywwg ywwg reopened this Jan 16, 2016
@ywwg
Copy link
Copy Markdown
Member Author

ywwg commented Jan 16, 2016

reopened! Massive reworking to make it interactive and non-blocking (although it is modal). still without official tests, though I will try to write some.

Comment thread src/library/baseplaylistfeature.cpp Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

trackLocations

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

actually I'm going to have the dialog take a list of TrackPointers instead of locations. In the future we may want to add more sophistication to the process, like make sure id3 tags are synced for each file, and even transcoding files on output. CDJs don't support flac, so if the user (e.g. me :)) wants to use their tracks on a CDJ, they'll need to convert FLACs to AIFF or WAV. By passing TrackPointers, we have a lot more information about the items being exported.

@daschuer
Copy link
Copy Markdown
Member

Nice feature! It would be cool if we add a metadata file that contains the cue points and other things that we have in Mixxx database and allow to import it by an other Mixxx instance.
But that is am other issue.

@ywwg
Copy link
Copy Markdown
Member Author

ywwg commented Jan 17, 2016

My sense is that your comment is less about an actual problem or shortcoming or bug with the design, and more just that if you'd done it yourself you'd do it differently. Unless you (or any one else) feels strongly about the ownership or gui/controller split, I'd prefer not to do that for now. When I revisit this feature to do file conversion or metadata export we can refactor the architecture as needed.

Comment thread src/library/baseplaylistfeature.cpp Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This has the same "could have an active search" issue -- did you want to make a new table model here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm not sure how to write this -- BasePlaylistFeature is a base class and I don't know how to say "make a copy of the implementation class". TODO

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Both PlaylistFeature and SetlogFeature use a PlaylistTableModel so you don't have to worry about that -- see slotExportPlaylist above which does the same sort of thing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

@rryan
Copy link
Copy Markdown
Member

rryan commented Jan 20, 2016

Overall usability wise I wonder what the likelihood is that two tracks have the same filename in a typical user collection. Like what if you have two album directories and each one is like "01.mp3" -- that's fairly common, right?

It would make the export feature kind of annoying to use since your only choices are a) overwrite one at "random" b) rename the file on disk and then get mIxxx to recognize that change and then re-export c) remove the file from the playlist/crate and re-export?

We know all the files that the user wants to export so we can predict collisions like that and prepend the directory name or something? Anyway, I don't see a strong need to deal with it in this PR, just idly wondering how common this complaint will be.

@rryan
Copy link
Copy Markdown
Member

rryan commented Jan 20, 2016

Overall the code looks like it's in good shape to me. I'm glad the std::future approach seems to work. It's a shame QFuture is so crappy :-/. thanks for the useful feature!

@ywwg
Copy link
Copy Markdown
Member Author

ywwg commented Jan 20, 2016

I'd like to make playlist entry deduping and file renaming a TODO for a subsequent PR, with the understanding that we don't want to release until those bugs are fixed.

@ywwg
Copy link
Copy Markdown
Member Author

ywwg commented Jan 20, 2016

notes addressed. I still have to write a test, but I did a basic export by hand and I didn't obviously break anything

@rryan
Copy link
Copy Markdown
Member

rryan commented Jan 20, 2016

I'd like to make playlist entry deduping and file renaming a TODO for a subsequent PR, with the understanding that we don't want to release until those bugs are fixed.

SGTM - this just gets the stake in the ground.

@rryan
Copy link
Copy Markdown
Member

rryan commented Jan 20, 2016

lgtm, thanks!

ywwg added a commit that referenced this pull request Jan 20, 2016
 Implement playlist and crate file export.
@ywwg ywwg merged commit 593fbfa into mixxxdj:master Jan 20, 2016
@Be-ing
Copy link
Copy Markdown
Contributor

Be-ing commented Jan 22, 2016

Thanks for starting work on this! :) Seems that a lot of users have been asking for this feature lately.

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.

6 participants