Default chapter ranges #163
Replies: 4 comments 5 replies
-
Every wiki on Github is backed by a normal git repository you can clone and interface with using |
Beta Was this translation helpful? Give feedback.
-
Here's already an example chapter that shouldn't have specific highlighting (using the default config): |
Beta Was this translation helpful? Give feedback.
-
@christoph-heinrich I like your patterns more then the default ones, which are a bit too loose. The @FichteFoll example would not happen with yours for instance. But I think you're overthinking it. This is just a couple patterns, we should just tweak them when someone comes with a string that should obviously not be matched. Currently, as I've noted, it's a bit too loose, and tries to match anything that could be a range. I think we should instead optimize to never match something that is not a range. IMO it's less confusing if something isn't transformed into a range, than having a UI display some range that doesn't make sense, and leaves the user wondering what is that rectangle there for. In practice, removing stuff like |
Beta Was this translation helpful? Give feedback.
-
Apparently "Intro" and "OP" are also occasionally used together … |
Beta Was this translation helpful? Give feedback.
-
I've been wondering about this for a while now and I don't know what the best way of dealing with this would be, so I'll just throw it out there.
There is a default configuration for chapter ranges in
uosc.conf
, but sometimes it behaves suboptimally. Of course that is to be expected to some degree, but I have modified mine and it has worked pretty well for me over the past two months.Now I could make a PR and hope that it works as well for other people as it did for me, but it sure would be great if there was some way of verifying that it works well other then just "try it for a while and see what happens".
We would need some sort of collection of chapter titles that it should match and also titles that it should not match, and it's probably good if people can contribute to that without having to create a PR, so maybe a wiki page like mpv has for user scripts. But the problem with the wiki page is conveniently getting those strings for the actual tests.
Regarding the test itself, it is possible to access functions and global variables from the main lua file directly from a test script as long as they are not defined as
local
. It is necessary to define some stubs to not have the lua interpreter scream at you when usingrequire uosc
in the test script, and any actually required functionality that's shipped by mpv needs to be replicated somehow. I locally have atest.lua
and aJSON.lua
that I use for testing whatever I'm currently working on in quality-menu. It's fairly primitive as it just barely covers what I needed since creating it and it's far from an actual unit test, but here is a listing in case you want to use parts of it. Btw, I used something similar to test the text wrapping, because starting mpv every time would have been a pain, but it didn't call usoc directly and instead i just copied code.The reason I bring it up now is because I've literally just run into the first false positive since using that configuration, and I don't know how to modify it without breaking something else.
Beta Was this translation helpful? Give feedback.
All reactions