Match Varied Language Names (full name, track number)
Much of my library includes subtitles that aren't in the format of `Movie.en.srt` but may include the subtitle track number (ie: Movie.2_en.srt / Movie.en (2).srt) or the full name (ie: Movie.English.srt / Movie.2_English.srt / Movie.English (2).srt).
Very often there are multiple English subtitles for example, possibly UK vs US English, possibly one that includes some hardcoded subs vs otherwise. While I don't mind changing the language names, the subtitles will then collide as there are then two English subtitles.
I would suggest that it is very easy to accommodate these subtitles by:
1. stripping out numbers/spaces/brackets/underscores from the final video name; and
2. case-insensitive converting full language names (English) to the ISO 639-1 codes (en).
Right now these srt files do not show up at all within Bazarr. Renaming them on disk has them appear.
Comments: 4
-
01 Feb, '22
Topper AdminI almost marked this as "won't happen" but I'll wait.
The way Bazarr is build, it can't support multiple subtitles with the exact same language. We only follow standard naming convention and we aren't planning to move to a custom naming scheme. -
02 Feb, '22
MichaelThat's fair and understandable.
Foremost: I certainly don't think supporting custom naming conventions *for writing* is helpful and admittedly not the *arr way (which typically keeps people to a regimented organization structure). Bazarr does the right thing here, writing a single srt file per language using the ISO code and I do believe that it should continue to do so. Writing this way would require the most effort as well for least gain and I don't think is necessary.
For the purposes of detecting if subtitles already exist,
1. While I can can easily change Movie.English.srt to Movie.en.srt in my library (and frankly may), this just seems to be easy to pass each language through a filter/function which basically does a filename.lower() and then replaces all of the full names with the two-letter code before detection.
2. The numbering/character is again a string function and could just discards any duplicates (as a duplicate wouldn't matter- you have an English sub)
Appreciated -
02 Feb, '22
MichaelIf there's an interest, I'd be happy to give it a whirl and do a PR, but of course always want to gauge interest and discuss the approach before putting in the time.
-
02 Feb, '22
Topper AdminJust draft how you would do it and come see us on our Discord server #community-dev channel.