TheCaptain989 / radarr-striptracks

A Docker Mod to Radarr/Sonarr to automatically remove unwanted audio and subtitle tracks
https://hub.docker.com/r/thecaptain989/radarr-striptracks
GNU General Public License v3.0
23 stars 1 forks source link

new flag to only keep forced subtitles #82

Open fatSquirrel42 opened 5 days ago

fatSquirrel42 commented 5 days ago

Wanted change New command-line argument with which you can control whether you only want to keep subtitles that are “forced” or all subtitles. The flag could work on a language-specific or global basis.

Reason for change Often there are forced subtitles in the same language as the audio track, which serve to give the viewer further context. I think it would add value if you could use a new flag to only keep subtitles that are marked as forced.

Personally, for example, I currently only keep English and German audio tracks because I understand them. In order to get the right subtitles, I now also keep all English and German subtitles. It would be enough for me if I only kept the forced subtitles.

TheCaptain989 commented 5 days ago

This is a good idea.

Are you thinking a --forced option? What should happen if it is paired with the --subs option?

fatSquirrel42 commented 5 days ago

--forced could have a global effect. This way only subtitles which are flagged as forced are kept. But it works in conjunction with --subs. So if you have --subs :eng --forced, you only get forced english subtitles.

A language-specific basis could be something like this: You can add languages to --forced, like you do with --subs and --audio. To keep the logic relative simple, it would probably best, that a wanted subtitle language has to be specified in --subs and --forced. So if you have --subs :eng:ger --forced :eng you get only forced english subtitles but all german subtitles.

TheCaptain989 commented 5 days ago

Hmmmm. That logic could get tricky.

What if instead a special language code is used? So --subs :frc would keep any forced subtitles. You could add other languages still, so --subs :eng:frc would keep English plus any forced subtitle.

This wouldn't allow for your first example of only English and forced, though. Is that really something you'd want to do?

fatSquirrel42 commented 5 days ago

I could live with that. Personally, I'm only interested in forced subtitles for certain languages. But if I can remove all subtitles that are not forced, that would also be helpful.

So if I were to use --subs :frc, I would get only the subtitles that are marked as forced? That doesn't sound too bad.

TheCaptain989 commented 5 days ago

Thanks for the explanation. Let me play around with it a bit. Once I get something to the appropriate stage, would you be willing to test?

fatSquirrel42 commented 5 days ago

Sure, just let me know.