-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
85 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f396ed1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some extra filetype filtering is needed with
script-message-to dialog open-folder
. I get the following error displayed with one of my folders (here it loads hidden system .ini into the playlist, on another folder it tries to load .cube files):[file] This is a directory - adding to playlist.
Playing: B:\Downloads\up/desktop.ini
Failed to recognize file format.
f396ed1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dialog.lua:
Default open file type should be Media Files(.mp4, .mkv, ...) rather than (.)
The displayed lists of extensions for video and audio files are also very long.
f396ed1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typos in https://github.com/tsl0922/mpv-menu-plugin/wiki/Scripting
srcript
instead of script.dialog.lua: should provide a script-messages example to copy/paste a string to clipboard, not only open clipboard filepath.
input.conf:
Ctrl+t script-message-to dialog set-clipboard ${time-pos/full} #menu: Open > Copy time to clipboard
To get a string from clipboard (ex a timestamp for a go-to-time feature) creating 'user-data/menu/clipboard' would be required in clipboard_cb
local function clipboard_cb(clipboard)
-- mp.commandv('loadfile', clipboard, 'append-play')
f396ed1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dir is loaded by mpv, this script doesn't list dir, it just pass the dir to mpv.
Maybe we can list the dir recursively and do the filter stuff.
Fixed.
screenshot? What do you mean, It should only show
Video Files
in the list.Well, I can't provide examples for everything, dialog.lua is meant to be a user script that can be used directly.
f396ed1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem in dialog.lua is that the clipboard callback is hardcoded to play the filepath. which causes dialog.lua to conflict with other
clipboard/get
uses (ex: I want to be able to display the clipboard string on screen rather than always try to open the file, I want to seek to clipboard timestamp).Is the reply sent to all scripts or only the script that put in the
clipboard/get
request ? I think it would be preferable if the clipboard callback just setuser-data/menu/clipboard
, maybe this could be done directly in c and the clipboard-get-reply message wouldn't be required ? In my go-to-time example simply observing 'user-data/menu/clipboard' seems to work.f396ed1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but still very long.
f396ed1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OS Version? I'm on win10:
f396ed1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it won't conflict, you should pass
mp.get_script_name()
as the last argument:f396ed1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Win10, Latest.
default App mode: Light.
f396ed1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have pushed a commit with new message design, and reduced the file extensions.
you may read the updated usage here: https://github.com/tsl0922/mpv-menu-plugin/wiki/File-Dialog