fix: language filter
This commit is contained in:
@@ -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)"];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user