-
Notifications
You must be signed in to change notification settings - Fork 75
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
Hide or show thumbnails based on config (profile) #575
Comments
Deciding for what files to generate thumbnails is definitely a thumbfast concern. uosc doesn't have any thumbfast related options. It just integrates with it by rendering thumbnails if thumbfast sends any. |
With your modification in place, you could make a script that hides/shows thumbnails based on your preferences using the script-binding command. |
Good idea. I tried to write a script that would take the script-opts value from the config and send the script-binding. But I couldn't accept script-opts from config. Do you know how to do it? |
@tomasklaen I don't think it's difficult. Your script has a function to hide thumbnails, which can be called manually just like I wrote in the first post. To call it automatically, you need to read the script-opts from the config. This can be done. In the original osc it was possible to pass functions through
|
You need to use read_options to get the values from the config file/script-opts. Most scripts use it (including uosc), so you can use those as a reference. |
I'm not saying it's difficult. I'm saying this is not uosc's concern. thumbfast controls thumbnails, we just integrate with it. In other words, if you want something like this to be built into uosc+thumbfast, you should make this issue in thumbfast's repo. Also, I think |
@christoph-heinrich |
thumbfast has an |
@po5 I did not find the |
I wrote this at 4am, turns out there's no such option yet :^) |
Updating Btw the documentation I've linked mentions that third parameter 😉 |
@christoph-heinrich I saw the line |
I thought you meant that updating script-opts during runtime doesn't change the options in the script, but do you mean that setting script-opts in a conditional profiles does not actually change the script-opts property itself? |
What I mean is that setting the |
I've made a little test now and it works just fine. test.lualocal options = require 'mp.options'
opts = {
something = "hi"
}
options.read_options(opts, "test", function(list)
print(opts.something)
end)
print(opts.something) mpv.confprofile=test
[test]
script-opts=test-something=test_profile
[test2]
profile-cond=vid == false
script-opts=test-something=test2_profile
profile-restore=copy-equal When not loading the profile in mpv.conf it prints Loading a profile in |
What you wrote works. Because you wrote |
I also tried to apply the profile via |
Moreover, at the moment it all makes no sense! I tried to do all this for the sake of |
I've now created a |
After adding bind_command('hide-thumbnails', function() print('hide') end)
bind_command('show-thumbnails', function() print('show') end) to uosc.lua and adding mp.add_key_binding('Y', 'asdf', function() mp.commandv('script-binding', 'uosc/hide-thumbnails') end) to test.lua I can say for sure that invoking the binding via script-binding from a script does work. |
I was talking about automatically applying script-binding based on script-opts |
Do your "cinema" files all have a common path? Something like Purely applying script-opts with your mpv.conf next to the video file is easy (literally just |
I tested on the same movie in d:\Movies folder. I don't understand how profile-restore can help me, I don't understand what you are talking about. The script-opts in mpv.conf near the video file (use-filedir-conf) doesn't work, I figured that out even before I started using uosc. |
Except that it does in fact work, as I've described in #575 (comment) |
I don't know why this option works for you and not for me. Possibly because I'm opening the video file from Windows Explorer instead of dragging it into the window of a pre-launched mpv. moviepath = (('d:\\Movies') or ('e:\\Movies') or ('e:\\Anime'))
ahkexe = 'c:\\ahk\\mpv-hide-thumbs-ahk.exe'
mp.register_event("file-loaded", function()
if string.find(mp.get_property("working-directory"), moviepath) then
mp.commandv('run', ahkexe)
end
end)
input.conf:
scripts\uosc_shared\elements\Timeline.lua
|
Feel free to discuss this further here, but since this doesn't seem to concern uosc I'm going to close it for now. |
In films, I don't want to spoil the future events of the plot for myself when I seek time with the mouse. So thumbfast should be disabled automatically if the video has a cinema profile applied to it, in which I pass script-opts options. Other videos on the computer do not contain a story, there thumbnails should be enabled by default.
So far, I have found only such a code that enables and disables thumbnails by key.
bind_command('hide-thumbnails', function() thumbnail.disabled = true end) bind_command('show-thumbnails', function() thumbnail.disabled = false end)
It is also needed, but for other purposes.
The text was updated successfully, but these errors were encountered: