fix: language filter

This commit is contained in:
2025-04-30 21:39:41 -05:00
parent 8970ca0f8f
commit f10168a1a7
7 changed files with 180 additions and 14 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Torrentio\Result;
use App\Util\CountryCodes;
use App\Util\CountryLanguages;
use Nihilarr\PTN;
class ResultFactory
@@ -89,13 +90,14 @@ class ResultFactory
});
$languages = array_map(function ($flag) {
return CountryCodes::convertFromAbbr(strtoupper(substr($flag['short_name'], strlen('flag-'))));
return CountryLanguages::fromCountryCode(strtoupper(substr($flag['short_name'], strlen('flag-'))));
},
$flags);
if (count($languages) > 0) {
return array_values($languages);
} else {
return ["English"];
return ["English (US)"];
}
}