mpv-playlistmanager
mpv-playlistmanager copied to clipboard
Paths with \ display newlines, tabs and other special characters
Items containing \N
or \n
are parsed in a different way.
Files 1 and 2 are local, files 3 and 4 are remote.
I'm not super sure in what part of the code the issue is. I was able to reporoduce it with local files.
I would suggest as a workaround to use the following filename_replace
in lua file
filename_replace = [[
[
{
"ext": { "all": true},
"rules": [
{ "\\" : "/" },
]
}
]
]],
in conf
filename_replace=[{"ext": {"all":true},"rules":[{"\\":"/"}]}]
This will change \ to /, I will consider making this a default if I can't manage to fix this bug.
Thank you for this workaround. I hope you will figure out what the issue is.
When the file name contains special characters of {
, it will also destroy the display of the playlist.
This is an ass escape character issue, refer to https://github.com/mpv-player/mpv/blob/94677723624fb84756e65c8f1377956667244bc9/player/lua/stats.lua#L145-L154
The file name displays one more character of \
when the following is applied.
filename_replace=[{"ext": {"all":true},"rules":[{"{":"\\{"}]}]
This is confusing, and I don't know how to display the correct file name.
See also https://github.com/libass/libass/issues/194#issuecomment-351902555.
Thanks, that looks promising. I will experiment with this later today. It's not complicated by itself, but this script does 2 different replacing of it's own (templates and user custom defined) and some custom escaping also, so the order probably is important. It could be any user defined replaces cannot fix this issue.
Almost tempted to create a test suite for all this escaping stuff :sweat_smile: