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

Project Files: Recursive folder import (drag-and-drop only) #3630

Merged
merged 5 commits into from
Oct 17, 2020

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Jul 28, 2020

Not too long ago (#3492), @CPUhead said, "I can't drag folders to the playlist". Well, now you can!

When processing drag-and-drop imports, OpenShot will recurse into any directories it finds, attempting to import all contained media. A few quirks of this mode:

  1. The import switches into a "silent running" mode, where the dialog box alerts about files that it can't import are turned off. Any unrecognized media will just be silently ignored.
  2. The import is totally flat ­— this doesn't add folders to Project Files, just lets you import all of the media inside a folder (and possibly subfolders) into the list, which is still as flat as ever.
  3. Image sequences are limited to one per directory — whether you say Yes or No to the question about importing a sequence, no other sequences will be detected in that same directory for the remainder of the import.
  4. As I was testing this, I actually found a few bugs in my previous image sequence import code, so a lot of that is rewritten and should be more robust even in the typical non-folder import cases. (That's what led to the new once-per-directory restriction, because it was doing all sorts of messed-up things when it tried to import a second one from the same path.)
  5. I have no idea what will happen if you drag a folder containing an .osp file in with other media, but I imagine it won't be pretty. Just don't do that.
  6. In general it's not even remotely bulletproof, nor is it intended to be. Kitchen-sink importing your entire media library on the off chance you might use something is still not a supported way of working with OpenShot, and Project Files is meant to hold only files that are actively in use on the Timeline. It is not a library, it is a workspace. If you try to do dumb things with this, it will almost certainly break and it'll be your own fault.
  7. The list of files being imported is now sorted before the import starts, because the results of Python's os.walk are all over the place and it was screwing up the image sequence imports to start from weird numbers.
  8. I switched over the non-drag-and-drop, dialog-driven Import Files over to using QUrl as well, hoping it would enable selection of folders for import that way, too — but at least on Linux with the GNOME Shell file-open dialog, that doesn't work. If you select a folder alone it will descend into it instead of opening it, and if you multiply-select folders and files together it simply refuses to accept the "Open" button click. So, that's a bummer. But I left the QUrl changes, because there's some chance it may open up opportunities for importing from more types of shared/network sources, at least on some platforms. I'll be curious to see what it changes, if anything.

Oh, and along the way I fixed the bug @leehockhin reported in #3554, about duplicate import attempts halting the import. Don't know how I missed that one.

Fixes #3492 fixes #3554 (and probably others)

@ferdnyc ferdnyc changed the title Project Files: Recursive folder import (drag-and-drop only?) Project Files: Recursive folder import (drag-and-drop only) Jul 28, 2020
@ferdnyc ferdnyc added interface GUI / user interface issues (i.e. windows, buttons, scrolling, pop-ups, etc...) media-handling Issues related to video/audio file processing & playback labels Jul 28, 2020
@ferdnyc ferdnyc force-pushed the import-folder branch 2 times, most recently from 44e0457 to 1bc2454 Compare July 28, 2020 08:35
@ferdnyc
Copy link
Contributor Author

ferdnyc commented Jul 28, 2020

Grrr. Everything was all set, then I went back to fix a few totally preexisting things that got flagged in the code, and a bunch of unrelated stuff snuck in that broke everything. That's what I get for revising on the fly.

@jonoomph
Copy link
Member

@ferdnyc What is the merge status of this one?

@jonoomph
Copy link
Member

This looks really cool, I would love to get it merged, if it's ready.

@jonoomph
Copy link
Member

I resolved the conflicts on this one, but I'll let @ferdnyc merge this one, once you feel it's ready. 👍

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Oct 17, 2020

@jonoomph

Good question, I haven't looked at this in MONTHS TBH. I'll take a look after I deal with the timer PR. I agree, it'd be nice to get in there. (Just wish I had a good way of making it also work for File-menu type imports.)

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Oct 17, 2020

Glad I checked this again, caught one dumb typo. Will merge as soon as Travis gives the OK.

@ferdnyc ferdnyc merged commit 685326f into OpenShot:develop Oct 17, 2020
@ferdnyc ferdnyc deleted the import-folder branch October 17, 2020 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interface GUI / user interface issues (i.e. windows, buttons, scrolling, pop-ups, etc...) media-handling Issues related to video/audio file processing & playback
Projects
None yet
2 participants