JKubovy / MPV-Watch-Later-OSD-Menu

This is a Lua script for the MPV media player that shows a list of the saved files in the "watch later" directory in an interactive menu.
The Unlicense
1 stars 0 forks source link

integrate uosc menu and not working #1

Closed WhoMI7 closed 1 year ago

WhoMI7 commented 1 year ago

looks good

JKubovy commented 1 year ago

Can you elaborate what is your question?

WhoMI7 commented 1 year ago

Ah, my bad. I asked if its possible to add uosc menu into this script. Just like this script. People with uosc will see the list in uosc menu and people without it will see it like the current default.

Also I couldn't the script to work (maybe because this isn't compatible with windows?) changing the values of key_showmenu = "SHIFT+ENTER" doesn't work because I have input-default-bindings=no

Maybe use input.conf for showmenu? Also do I need to change watch_later path here too local watch_later_path = mp.command_native({"expand-path", "~~home/watch_later"})

If I add u script-binding showmenu to input.conf I get this error

[watch_later_osd_menu] stack traceback:
[watch_later_osd_menu]  ...guy\AppData\Roaming/mpv/scripts/watch_later_osd_menu.lua:49: in function 'parse_watch_later_files'
[watch_later_osd_menu]  ...guy\AppData\Roaming/mpv/scripts/watch_later_osd_menu.lua:273: in function 'load_globals'
[watch_later_osd_menu]  ...guy\AppData\Roaming/mpv/scripts/watch_later_osd_menu.lua:279: in function 'fn'
[watch_later_osd_menu]  mp.defaults:230: in function 'fn'
[watch_later_osd_menu]  mp.defaults:65: in function 'handler'
[watch_later_osd_menu]  mp.defaults:380: in function 'handler'
[watch_later_osd_menu]  mp.defaults:510: in function 'call_event_handlers'
[watch_later_osd_menu]  mp.defaults:552: in function 'dispatch_events'
[watch_later_osd_menu]  mp.defaults:503: in function <mp.defaults:502>
[watch_later_osd_menu]  [C]: at 0x7ff6189edf50
[watch_later_osd_menu]  [C]: at 0x7ff6189ee440
[watch_later_osd_menu] Lua error: ...guy\AppData\Roaming/mpv/scripts/watch_later_osd_menu.lua:49: bad argument #1 to 'ipairs' (table expected, got nil)
JKubovy commented 1 year ago

I'm using Windows so it's definitely compatible. In mpv.conf I have option no-input-default-bindings and in input.conf I have line Shift+Enter script-binding watch_later_osd_menu/showmenu.

To be honest I don't know uosc and never test it. Maybe I will look in to it.

And line local watch_later_path = mp.command_native({"expand-path", "~~home/watch_later"}) is wrong, there should be settings.watch_later_folder instead of path ~~home/watch_later. I'm going to fix it.

WhoMI7 commented 1 year ago

Still doesn't work

[watch_later_osd_menu] 
[watch_later_osd_menu] stack traceback:
[watch_later_osd_menu]  ...guy\AppData\Roaming/mpv/scripts/watch_later_osd_menu.lua:71: in function 'parse_filename_by_index'
[watch_later_osd_menu]  ...guy\AppData\Roaming/mpv/scripts/watch_later_osd_menu.lua:136: in function 'draw_playlist'
[watch_later_osd_menu]  ...guy\AppData\Roaming/mpv/scripts/watch_later_osd_menu.lua:285: in function 'fn'
[watch_later_osd_menu]  mp.defaults:230: in function 'fn'
[watch_later_osd_menu]  mp.defaults:65: in function 'handler'
[watch_later_osd_menu]  mp.defaults:380: in function 'handler'
[watch_later_osd_menu]  mp.defaults:510: in function 'call_event_handlers'
[watch_later_osd_menu]  mp.defaults:552: in function 'dispatch_events'
[watch_later_osd_menu]  mp.defaults:503: in function <mp.defaults:502>
[watch_later_osd_menu]  [C]: at 0x7ff63ee0df50
[watch_later_osd_menu]  [C]: at 0x7ff63ee0e440
[watch_later_osd_menu] Lua error: ...guy\AppData\Roaming/mpv/scripts/watch_later_osd_menu.lua:71: bad argument #2 to 'gsub' (string/function/table expected)
[watch_later_osd_menu] Exiting...
JKubovy commented 1 year ago

Do you have enabled write-filename-in-watch-later-config in mpv.conf and redone your saves? Without this option there is no filename path in watch_later files. If you open one of your watch_later file (eg. file 96FBA8703D16C61BC064630EAF8D7A58) it should look like this:

# C:\Users\<User>\Videos\Considering Rust.webm
start=52.201000
pause=yes
WhoMI7 commented 1 year ago

Do you have enabled write-filename-in-watch-later-config in mpv.conf and redone your saves? Without this option there is no filename path in watch_later files. If you open one of your watch_later file (eg. file 96FBA8703D16C61BC064630EAF8D7A58) it should look like this:

# C:\Users\<User>\Videos\Considering Rust.webm
start=52.201000
pause=yes

Yes, I've had it like that for years

JKubovy commented 1 year ago

Can you backup your watch_later folder and keep there just one file with which it crash and send me content of that file? I will try to debug it.

WhoMI7 commented 1 year ago

Deleting all the watch_later files fixed it. Though new problem arose: It's breaking uosc.

https://user-images.githubusercontent.com/93109835/213679825-f6261b12-6861-4cc8-8eb0-3608db2b0ef8.mp4

Is it possible to fix this? Might be a longshot. Many scripts have a tendency to break uosc.

JKubovy commented 1 year ago

As I mentioned earlier I don't know uosc and honestly I don't know what are you showing to me on the video. I've never seen how uosc should behave.

IMHO the problem could be I use default OSC and uosc use it's own. When I call mp.set_osd_ass(w, h, ass.text) it starts to 'fight uosc OSC'. I'm afraid someone else should look into it, someone with experience with uosc.

WhoMI7 commented 1 year ago

As I mentioned earlier I don't know uosc and honestly I don't know what are you showing to me on the video. I've never seen how uosc should behave.

Yeah, I realized that later, my bad.

IMHO the problem could be I use default OSC and uosc use it's own. When I call mp.set_osd_ass(w, h, ass.text) it starts to 'fight uosc OSC'. I'm afraid someone else should look into it, someone with experience with uosc.

I asked that to uosc's author, thanks.

Closing the issue.