ratoaq2 / knowit

Know better your media files
MIT License
28 stars 5 forks source link

Update general.py for matching both the B and T variants of 3-letter codes #168

Closed rmichelena closed 2 weeks ago

rmichelena commented 2 weeks ago

Fix for matching 3-letter language codes in both the alpha3b and alpha3t methods (as per ISO 639-3)

Specifically, for French, "fre" is being recognized, but "fra" is not (yields null). Babelfish has 2 methods for 3-letter codes, alpha3b and alpha3t (as per ISO 639-3 "B" and "T" values).

With this change, when resolving a 3-letter code, Knowit will first try babelfish's alpha3b, and if that fails, will then try alpha3t, and only if that also fails will resort to IETF

ratoaq2 commented 2 weeks ago

thanks