Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS expressions function not working for me. #2059

Closed
5 tasks done
sportniik opened this issue Jun 28, 2024 · 4 comments
Closed
5 tasks done

JS expressions function not working for me. #2059

sportniik opened this issue Jun 28, 2024 · 4 comments

Comments

@sportniik
Copy link

The fewer issues I have to read, the more new features I will have time to implement, so I ask that you please try these things first

Operating System

Windows 10

Steps to reproduce

I used " segment.duration < 5 "

Expected behavior

All segments with duration less than 5 sec should be selected (as I understand).

Actual behavior

Nothing is selected, although I have few segments with less than 5 sec. The JS expression window does not close when I click "OK".

Share log from developer tools

No response

@mifi
Copy link
Owner

mifi commented Aug 5, 2024

this is the nightly build, right? do you see any error message in developer tools javascript console? it works for me on macos but it could be an issue on windows. I saw this error message in an unrelated issue #2070 - and i have a feeling it's related:

index.html:1 Refused to execute script from 'file:///D:/Downloads/LosslessCut-win-x64%20(1)/resources/app.asar/out/renderer/assets/evalWorker-2659dcda.ts' because its MIME type ('video/vnd.dlna.mpeg-tts') is not executable.

@mifi
Copy link
Owner

mifi commented Aug 6, 2024

I've managed to reproduce the problem on windows and I think I've found the issue vitejs/vite#11823

@mifi mifi closed this as completed in 6e60133 Aug 6, 2024
@sportniik
Copy link
Author

sportniik commented Aug 7, 2024

Thank you! Yes it works now. I have also tried it on 3.62.

I do have one question about this syntaxes that are available to click. "Segment label (exact)" and "Segment label (regexp)". The latter I do not understand.
For instance, if a segment label was "Video 3" and I input "/^Video 3/.test(segment.label)"; that segment would be selected. If I would only use "/^Video/.test(segment.label)", no number 3 added, it would not select anything.
So my question is what is the difference between (exact) and (regexp) syntax, cause the regexp looks to do same thing as exact?

Cause we can label segments like: Picnic - beginning. Picnic - cooking, Picnic - swimming ... Back at home - Dinner, Back at home - Piano, Back at home - Bedtime
So if I want to export only Picnic, I have to select all the segments with that label. If the video has only 6 segments that is no problem, but many have 50 segments or more. So having a syntax that would select segments that have word "Picnic" in their label would be very handy.

Thank you!

UPDATE:
"Segment label (regexp)" works (selecting only segments with word Picnic)!
First time I tried that syntax I only made 5 segments and they all had word Picnic on label. And using regexp gave no result, cause LLC did not select any segments. Than I added another segment, that was without Label, BAM, than it was working.

Hope it helps, if anyone has problems with this syntax.

@mifi
Copy link
Owner

mifi commented Aug 15, 2024

Yes i purposefully made it so that if it's matching all segments, then it will not actually select anything, because that would not be very useful. I will make it so that it instead gives an error if all match

mifi added a commit that referenced this issue Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants