mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 13:56:16 +00:00
feat: Add functions for multiplayer repack, multi-language support, and repack language based on repacker
This commit is contained in:
19
src/renderer/src/helpers/searcher.ts
Normal file
19
src/renderer/src/helpers/searcher.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
export const isMultiplayerRepack = (title: string) => {
|
||||
const toLower = title.toLowerCase();
|
||||
|
||||
return toLower.includes("multiplayer") || toLower.includes("onlinefix") || toLower.includes("online fix")
|
||||
}
|
||||
|
||||
export const supportMultiLanguage = (title: string) => {
|
||||
const multiFollowedByDigitsRegex = /multi\d+/;
|
||||
|
||||
return multiFollowedByDigitsRegex.test(title.toLowerCase());
|
||||
}
|
||||
|
||||
export const getRepackLanguageBasedOnRepacker = (repacker: string) => {
|
||||
const repackMap = {
|
||||
'xatab': 'ru',
|
||||
}
|
||||
|
||||
return repackMap[repacker.toLowerCase()] || 'en';
|
||||
}
|
||||
Reference in New Issue
Block a user