Commit f37e372
committed
cplayer: Fix %f expansion in screenshot template
Do not call mp_basename() again. 'filename' is already the basename
according to the man page. Plus, it makes it inconsistent with
%{filename}, which gets no special treatment (basename) in the property
expansion case.
Previous behavior resluts in an empty string if 'filename' is a URL that
ends with a '/', which in turn would lead to 'screenshot-dir' being
ignored or overwritten with '/' in case of nesting screenshot dirs per
file, e.g.:
$ mpv \
--screenshot-dir='~/tmp/mpv-shots' \
--screenshot-template='%f/%P' \
https://example.org/video/
This happens with ytdl-hook on some sites.
I think this points to a related bug in mp_basename, because directories
do have a basename. A trailing '/' should be stripped IMO. And there
must be some inconsistency in how the filename property gets set,
because it is simply being set to the whole URL, so some other kind of
basename function or a different fallback is used.1 parent 28ef6b7 commit f37e372
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| |||
0 commit comments