Skip to content

problem when setting the watch-later-directory using an auto-profile #15670

Answered by S-Aarab
S-Aarab asked this question in Q&A
Discussion options

You must be logged in to vote

I managed to solve this problem by using a Lua script that retrieves the current playlist's filename, as it is available earlier, and uses it instead of the path, since both have the same value.

mp.add_hook('on_before_start_file', 50, function()
    for _, entry in ipairs(mp.get_property_native('playlist', {})) do
        if entry.current then
            mp.set_property_native('user-data/playlist_current_filename', entry.filename)
            break
        end
    end
end)

mp.add_hook('on_after_end_file', 50, function()
    mp.set_property_native('user-data/playlist_current_filename', nil)
end)
[default]   
watch-later-directory = /tmp/mpv/watch_later
save-position-on-quit = yes
    
[…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by S-Aarab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant