NoelDeMartin / media-kraken

Track your movies with Media Kraken
https://noeldemartin.github.io/media-kraken/
GNU General Public License v3.0
72 stars 6 forks source link

Root domain for externalUrls with country TLD #37

Open josephguillaume opened 1 month ago

josephguillaume commented 1 month ago

Another very minor issue that I'm sharing for completeness, sorry! Feel free to close as won't fix.

The code for parseRootDomain assumes a two part root domain https://github.com/NoelDeMartin/media-kraken/blob/26c09436cbf71236fee03c034025750c7769454c/src/utils/Url.ts#L59

This breaks down e.g. for externalUrls with country TLD e.g. https://www.sbs.com.au/ondemand/movie/ten-canoes/11858499617 renders as "view at com.au" https://iview.abc.net.au/show/imitation-game renders as "view at net.au"

A general solution seems non-trivial, but here's one that would be a relatively minor adjustment https://github.com/capturr/get-root-domain/blob/main/src/index.ts

NoelDeMartin commented 1 month ago

Hm yeah, that definitely looks like a bug, I'll look into it next time I work on the project. Thanks for opening an issue :).