Replies: 4 comments 5 replies
-
If you don't want forced tracks to be selected you can use the condition field: {
"alang": "eng",
"slang": "eng",
"condition": "not sub.forced"
} If you actually want the number of tracks for some reason you can do it with a more complex condition: {
"alang": "eng",
"slang": "eng",
"condition": "(function() local num_audio = 0; for _, track in ipairs(mp.get_property_native('track-list', {})) do num_audio = num_audio + (track.type == 'audio' and 1 or 0) end; return num_audio == 2; end)()"
} You can see at the very end I have This is a pretty clunky way of writing a condition. I could be convinced to make it easier if anyone shows a further need to search the track list. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
This will not match to any of the subtitles in that file because none of them have
This will not match to any subtitles in that file because that file has 4 subtitle tracks, but that condition, as you requested, returns true if there are exactly 2 subtitles tracks in the file. If there were two it would still match to the forced track because it comes first and you haven't included If you specifically want to match to the second sub track then do {
"alang": "*",
"slang": "eng?",
"condition": "not sub.forced"
} |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I have it configured it in a way such that if a file contains alang: jap and eng both (Anime for example) then it's priority should be selecting japanese audio without sign and songs track (select full subtitle), and if I switch to eng audio then it will automatically switch to signs and songs track.
But the problem exists when I want to watch a english movie, say Black Panther for example. Now it only has english audio but now it shouldn't switch to forced (which only has translation to any language other than english) track.
I don't know if it's making sense or not. Maybe it's already possible?
What I am asking is: Is it possible that selection is made on the basis of number of audios?
If a file has only english audio then it would select english (Full Subtitle or SDH), not forced.
Something like uosc's button config, where we can set button to appear on the basis of number of tracks present in a file(audio,has_audio,has_many_audio) but for subtitle selection.
https://github.com/tomasklaen/uosc/blob/main/script-opts/uosc.conf#L54
Beta Was this translation helpful? Give feedback.
All reactions