mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-03 07:16:31 +01:00
support xbmc naming convention for subtitles
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
using MediaBrowser.Controller.Localization;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Globalization;
|
||||
using MoreLinq;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Localization
|
||||
{
|
||||
/// <summary>
|
||||
/// Class LocalizationManager
|
||||
/// </summary>
|
||||
public class LocalizationManager : ILocalizationManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the cultures.
|
||||
/// </summary>
|
||||
/// <returns>IEnumerable{CultureDto}.</returns>
|
||||
public IEnumerable<CultureDto> GetCultures()
|
||||
{
|
||||
return CultureInfo.GetCultures(CultureTypes.AllCultures)
|
||||
.OrderBy(c => c.DisplayName)
|
||||
.DistinctBy(c => c.TwoLetterISOLanguageName + c.ThreeLetterISOLanguageName)
|
||||
.Select(c => new CultureDto
|
||||
{
|
||||
Name = c.Name,
|
||||
DisplayName = c.DisplayName,
|
||||
ThreeLetterISOLanguageName = c.ThreeLetterISOLanguageName,
|
||||
TwoLetterISOLanguageName = c.TwoLetterISOLanguageName
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the countries.
|
||||
/// </summary>
|
||||
/// <returns>IEnumerable{CountryInfo}.</returns>
|
||||
public IEnumerable<CountryInfo> GetCountries()
|
||||
{
|
||||
return CultureInfo.GetCultures(CultureTypes.SpecificCultures)
|
||||
.Select(c => new RegionInfo(c.LCID))
|
||||
.OrderBy(c => c.DisplayName)
|
||||
.DistinctBy(c => c.TwoLetterISORegionName)
|
||||
.Select(c => new CountryInfo
|
||||
{
|
||||
Name = c.Name,
|
||||
DisplayName = c.DisplayName,
|
||||
TwoLetterISORegionName = c.TwoLetterISORegionName,
|
||||
ThreeLetterISORegionName = c.ThreeLetterISORegionName
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the parental ratings.
|
||||
/// </summary>
|
||||
/// <returns>IEnumerable{ParentalRating}.</returns>
|
||||
public IEnumerable<ParentalRating> GetParentalRatings()
|
||||
{
|
||||
return Ratings.RatingsDict
|
||||
.Select(k => new ParentalRating {Name = k.Key, Value = k.Value})
|
||||
.OrderBy(p => p.Value)
|
||||
.Where(p => p.Value > 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -138,6 +138,7 @@
|
||||
<Compile Include="Library\Resolvers\TV\SeriesResolver.cs" />
|
||||
<Compile Include="Library\Resolvers\VideoResolver.cs" />
|
||||
<Compile Include="Library\UserManager.cs" />
|
||||
<Compile Include="Localization\LocalizationManager.cs" />
|
||||
<Compile Include="MediaEncoder\MediaEncoder.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Providers\ProviderManager.cs" />
|
||||
|
||||
Reference in New Issue
Block a user