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

Load video by drag-and-drop #59

Closed
val461 opened this issue Jul 29, 2017 · 3 comments
Closed

Load video by drag-and-drop #59

val461 opened this issue Jul 29, 2017 · 3 comments

Comments

@val461
Copy link

val461 commented Jul 29, 2017

When dragging and dropping a video file on Gaupol, it tells the user that the file seems too big to be a text-based subtitle file. I suggest asking the user to choose between loading the file as a video or as subtitles. (Edit: the issue also happens when passing a video file as an argument when launching Gaupol from the command line. The -v option does not solve the issue as it does not load the video in Gaupol's player.)

@aaaxx
Copy link

aaaxx commented Jul 29, 2017

It would be better to skip the dialogue and just load it as video if the file has any of the supported video extensions.

@val461
Copy link
Author

val461 commented Jul 29, 2017

Sure, I just assumed that extension might not be enough to determine unambiguously whether the file contained a video or subtitles.

@val461 val461 changed the title suggestion: new dialog box on drag-and-drop suggestion: load video through drag-and-drop Jul 29, 2017
@val461 val461 changed the title suggestion: load video through drag-and-drop suggestion: load video by drag-and-drop Jul 29, 2017
@otsaloma otsaloma changed the title suggestion: load video by drag-and-drop Load video by drag-and-drop Aug 3, 2017
@otsaloma
Copy link
Owner

otsaloma commented Aug 3, 2017

Good idea. The detection can be done by Python's mimetypes module, checking for video/* mimetype and falling back on a list of filename extensions, as the mimetypes module doesn't work well on Windows. That detection code already exists, just needs some refactoring to use it for drag and drop. I'll add this along with the next batch of fixes.

https://docs.python.org/3/library/mimetypes.html#mimetypes.guess_type

https://github.com/otsaloma/gaupol/blob/master/aeidon/agents/preview.py#L25

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

No branches or pull requests

3 participants