dyphire / mpv-scripts

userscripts for mpv
MIT License
68 stars 5 forks source link

chapter-make-read.lua: Autodetection of sidecar file also for basename.chp #15

Closed porg closed 1 year ago

porg commented 1 year ago
dyphire commented 1 year ago

This is an old behavior that has been deprecated in the commit https://github.com/dyphire/mpv-scripts/commit/5b86d13527a6f41b24985dae1d963f29a143c310. The reason for adding extension matching is to avoid incorrect matching between files with the same name but different extensions.

whereas vid.chp would be a sidecar file to both vid.mp4 and vid.avi

I completely cannot imagine the existence of such usage scenarios, why the same content retains two or more different files. This is probably not a real use case.

porg commented 1 year ago

Hi, exactly that's why I stated it: Having both vid.mp4 and vid.avi is quite unlikely!

So, please re-introduce the old behavior you mentined, at least as an additional way.

porg commented 1 year ago
dyphire commented 1 year ago

Tackling this very issue here by re-introducing basename.chp as an additional valid filename pattern, and Chapter files in mpv on the Mac would work really fine then.

Yes, I am considering re implementing it. The only issue is whether the two modes need to coexist, which will result in multiple detections of the existence of chapter files.

Considering that both modes can meet over 99% of usage scenarios, I tend to add a new option that allows users to choose the matching mode to use.

porg commented 1 year ago

✅ Tested b0cd966 and it works: