bazarr icon indicating copy to clipboard operation
bazarr copied to clipboard

fix_uppercase should run after remove_HI is finished

Open Jakob-Koschel opened this issue 2 years ago • 3 comments

Describe the bug Not exactly sure if it's a 'bug' and if this is only very specific for the subtitles I have (extracted using the "Embedded Subtitles" provider. The subtitles look like this:

9
00:00:41,417 --> 00:00:43,127
OW!

10
00:00:43,127 --> 00:00:44,754
BACK UP!

11
00:00:44,754 --> 00:00:47,590
COMING OUT!

12
00:01:02,271 --> 00:01:05,566
(Slim Smith & the Uniques'
"My Conversation" playing)

Everything apart from the HI is uppercase. So if I manually first 'remove HI' and then 'Fix uppercase' then it works correctly.

However because 'only_uppercase' is determined before 'remove HI' is run (when enabling the different post processing steps to run automatically), the variables self.only_uppercase (https://github.com/morpheus65535/bazarr/blob/master/libs/subzero/modification/main.py#L213) is set to false. Then the fix_uppercase modification will be skipped completely.

To Reproduce Take any subtitles that are all uppercase, except for the HI texts. If enabling the post processing to remove HI and fix uppercase, only the HI will be removed.

Expected behavior When manually first removing HI and then fixing uppercase it works.

Software (please complete the following information):

  • Bazarr: [v 1.1.0]
  • Linux Ubuntu 20.04

Additional context I guess 'only_uppercase' should be checked after 'remove_HI' has been run. I wonder if checking if everything is uppercase or not makes more sense within the modify function of the FixUppercase class?

[EDIT]: just realized that actually the issue is the HI element spanning over two lines. It looks like: FullBracketEntryProcessor (which is run from here: https://github.com/morpheus65535/bazarr/blob/master/libs/subzero/modification/main.py#L190) should be executed on the entire 'entry' instead of on every single line separately.

I tried moving detect_uppercase() into FixUppercase and it works, I can prepare a PR for that if that is desired.

Jakob-Koschel avatar Aug 25 '22 07:08 Jakob-Koschel

Thanks for reporting this issue. Yes I would appreciate if you could create a PR to dev branch for that one. Thanks!

morpheus65535 avatar Aug 28 '22 13:08 morpheus65535

ok will do, but will take some time until I can clean it up.

Jakob-Koschel avatar Aug 29 '22 19:08 Jakob-Koschel

ok will do, but will take some time until I can clean it up.

No problem, thanks for that!

morpheus65535 avatar Aug 29 '22 19:08 morpheus65535

@Jakob-Koschel any new with this ?

halali avatar Feb 18 '23 20:02 halali

Had this laying around for ages, finally submitted. Thanks for the ping.

Jakob-Koschel avatar Feb 18 '23 21:02 Jakob-Koschel

Should have been fixed in #2067. I close this issue.

morpheus65535 avatar Mar 22 '23 17:03 morpheus65535