diff --git a/app/Config/GiteaConfig.php b/app/Config/GiteaConfig.php index fc85f61..3122c97 100644 --- a/app/Config/GiteaConfig.php +++ b/app/Config/GiteaConfig.php @@ -4,6 +4,7 @@ namespace App\Config; final class GiteaConfig { public const RAW_ITEMS_URL = 'https://dev.sp-tarkov.com/SPT-AKI/Server/raw/branch/development/project/assets/database/templates/items.json'; + public const RAW_CUSTOMIZATION_URL = 'https://dev.sp-tarkov.com/SPT-AKI/Server/raw/branch/development/project/assets/database/templates/customization.json'; public const LOCALES_GLOBAL_URL = 'https://dev.sp-tarkov.com/api/v1/repos/SPT-AKI/Server/contents/project%2Fassets%2Fdatabase%2Flocales%2Fglobal'; public const RAW_LOCALES_GLOBAL_BASE_URL = 'https://dev.sp-tarkov.com/SPT-AKI/Server/raw/branch/development/project/assets/database/locales/global/'; } \ No newline at end of file diff --git a/app/Data/ItemsCollection.php b/app/Data/ItemsCollection.php index 26a3b7a..9a86f2b 100644 --- a/app/Data/ItemsCollection.php +++ b/app/Data/ItemsCollection.php @@ -44,14 +44,15 @@ class ItemsCollection if (empty($current_locale_name) || !$current_locale_name[1][0]) continue; $trimmed_current_locale_name = trim($current_locale_name[1][0]); - $current_locale = collect([$trimmed_current_locale_name => json_decode(file_get_contents("${raw_locales_global_base_url}/${trimmed_current_locale_name}.json"), true)['templates']]); - $this->locales = $this->locales->merge($current_locale); + $current_locale_json = json_decode(file_get_contents("${raw_locales_global_base_url}/${trimmed_current_locale_name}.json"), true); + $this->locales = $this->locales->merge([$trimmed_current_locale_name => [collect($current_locale_json['templates'])->merge(collect($current_locale_json['customization']))]]); } Cache::put($this->locales_cache_key, $this->locales); } public function refreshItemsCache(): void { $this->items = collect(json_decode(file_get_contents(GiteaConfig::RAW_ITEMS_URL), true)); + $this->items = $this->items->merge(collect(json_decode(file_get_contents(GiteaConfig::RAW_CUSTOMIZATION_URL), true))); Cache::put($this->items_cache_key, $this->items); }