diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index c732e27d68..68a56607e9 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -202,6 +202,7 @@ namespace MediaBrowser.Api.UserLibrary /// private readonly ILibraryManager _libraryManager; private readonly ILibrarySearchEngine _searchEngine; + private readonly ILocalizationManager _localization; /// /// Initializes a new instance of the class. @@ -451,17 +452,47 @@ namespace MediaBrowser.Api.UserLibrary // Min official rating if (!string.IsNullOrEmpty(request.MinOfficialRating)) { - var level = Ratings.Level(request.MinOfficialRating); + var level = _localization.GetRatingLevel(request.MinOfficialRating); - items = items.Where(i => Ratings.Level(i.CustomRating ?? i.OfficialRating) >= level); + if (level.HasValue) + { + items = items.Where(i => + { + var rating = i.CustomRating ?? i.OfficialRating; + + if (string.IsNullOrEmpty(rating)) + { + return true; + } + + var itemLevel = _localization.GetRatingLevel(rating); + + return !itemLevel.HasValue || itemLevel.Value >= level.Value; + }); + } } // Max official rating if (!string.IsNullOrEmpty(request.MaxOfficialRating)) { - var level = Ratings.Level(request.MaxOfficialRating); + var level = _localization.GetRatingLevel(request.MinOfficialRating); - items = items.Where(i => Ratings.Level(i.CustomRating ?? i.OfficialRating) <= level); + if (level.HasValue) + { + items = items.Where(i => + { + var rating = i.CustomRating ?? i.OfficialRating; + + if (string.IsNullOrEmpty(rating)) + { + return true; + } + + var itemLevel = _localization.GetRatingLevel(rating); + + return !itemLevel.HasValue || itemLevel.Value <= level.Value; + }); + } } // Exclude item types diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 64d3810fae..974b3f864e 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -143,6 +143,7 @@ namespace MediaBrowser.Controller.Entities public static ILibraryManager LibraryManager { get; set; } public static IServerConfigurationManager ConfigurationManager { get; set; } public static IProviderManager ProviderManager { get; set; } + public static ILocalizationManager LocalizationManager { get; set; } /// /// Returns a that represents this instance. @@ -1081,9 +1082,10 @@ namespace MediaBrowser.Controller.Entities /// Determines if a given user has access to this item /// /// The user. + /// The localization manager. /// true if [is parental allowed] [the specified user]; otherwise, false. - /// - public bool IsParentalAllowed(User user) + /// user + public bool IsParentalAllowed(User user, ILocalizationManager localizationManager) { if (user == null) { @@ -1095,12 +1097,22 @@ namespace MediaBrowser.Controller.Entities return true; } - if (user.Configuration.BlockNotRated && string.IsNullOrEmpty(CustomRating ?? OfficialRating)) + var rating = CustomRating ?? OfficialRating; + + if (user.Configuration.BlockNotRated && string.IsNullOrEmpty(rating)) { return false; } - return Ratings.Level(CustomRating ?? OfficialRating) <= user.Configuration.MaxParentalRating.Value; + var value = localizationManager.GetRatingLevel(rating); + + // Could not determine the integer value + if (!value.HasValue) + { + return true; + } + + return value.Value <= user.Configuration.MaxParentalRating.Value; } /// @@ -1117,7 +1129,7 @@ namespace MediaBrowser.Controller.Entities throw new ArgumentNullException("user"); } - return IsParentalAllowed(user); + return IsParentalAllowed(user, LocalizationManager); } /// diff --git a/MediaBrowser.Controller/Localization/AURatingsDictionary.cs b/MediaBrowser.Controller/Localization/AURatingsDictionary.cs deleted file mode 100644 index 882302f103..0000000000 --- a/MediaBrowser.Controller/Localization/AURatingsDictionary.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections.Generic; - -namespace MediaBrowser.Controller.Localization -{ - /// - /// Class AURatingsDictionary - /// - public class AURatingsDictionary : Dictionary - { - /// - /// Initializes a new instance of the class. - /// - public AURatingsDictionary() - { - Add("AU-G", 1); - Add("AU-PG", 5); - Add("AU-M", 6); - Add("AU-M15+", 7); - Add("AU-R18+", 9); - Add("AU-X18+", 10); - } - } -} diff --git a/MediaBrowser.Controller/Localization/GBRatingsDictionary.cs b/MediaBrowser.Controller/Localization/GBRatingsDictionary.cs deleted file mode 100644 index 414abdd59d..0000000000 --- a/MediaBrowser.Controller/Localization/GBRatingsDictionary.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Collections.Generic; - -namespace MediaBrowser.Controller.Localization -{ - /// - /// Class GBRatingsDictionary - /// - public class GBRatingsDictionary : Dictionary - { - /// - /// Initializes a new instance of the class. - /// - public GBRatingsDictionary() - { - Add("GB-U", 1); - Add("GB-PG", 5); - Add("GB-12", 6); - Add("GB-12A", 7); - Add("GB-15", 8); - Add("GB-18", 9); - Add("GB-R18", 15); - } - } -} diff --git a/MediaBrowser.Controller/Localization/ILocalizationManager.cs b/MediaBrowser.Controller/Localization/ILocalizationManager.cs index 487c4a48e6..ecafec48a6 100644 --- a/MediaBrowser.Controller/Localization/ILocalizationManager.cs +++ b/MediaBrowser.Controller/Localization/ILocalizationManager.cs @@ -24,5 +24,11 @@ namespace MediaBrowser.Controller.Localization /// /// IEnumerable{ParentalRating}. IEnumerable GetParentalRatings(); + /// + /// Gets the rating level. + /// + /// The rating. + /// System.Int32. + int? GetRatingLevel(string rating); } } diff --git a/MediaBrowser.Controller/Localization/NLRatingsDictionary.cs b/MediaBrowser.Controller/Localization/NLRatingsDictionary.cs deleted file mode 100644 index 7a20f50ba4..0000000000 --- a/MediaBrowser.Controller/Localization/NLRatingsDictionary.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections.Generic; - -namespace MediaBrowser.Controller.Localization -{ - /// - /// Class NLRatingsDictionary - /// - public class NLRatingsDictionary : Dictionary - { - /// - /// Initializes a new instance of the class. - /// - public NLRatingsDictionary() - { - Add("NL-AL", 1); - Add("NL-MG6", 2); - Add("NL-6", 3); - Add("NL-9", 5); - Add("NL-12", 6); - Add("NL-16", 8); - } - } -} diff --git a/MediaBrowser.Controller/Localization/Ratings.cs b/MediaBrowser.Controller/Localization/Ratings.cs deleted file mode 100644 index bc4ebab4e4..0000000000 --- a/MediaBrowser.Controller/Localization/Ratings.cs +++ /dev/null @@ -1,184 +0,0 @@ -using System.Globalization; -using MediaBrowser.Controller.Configuration; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace MediaBrowser.Controller.Localization -{ - /// - /// Class Ratings - /// - public static class Ratings - { - public static IServerConfigurationManager ConfigurationManager; - - /// - /// The ratings def - /// - private static RatingsDefinition ratingsDef; - /// - /// The _ratings dict - /// - private static Dictionary _ratingsDict; - /// - /// Gets the ratings dict. - /// - /// The ratings dict. - public static Dictionary RatingsDict - { - get { return _ratingsDict ?? (_ratingsDict = Initialize(false, ConfigurationManager)); } - } - /// - /// The ratings strings - /// - private static readonly Dictionary ratingsStrings = new Dictionary(); - - /// - /// Tries the add. - /// - /// The type of the T key. - /// The type of the T value. - /// The dictionary. - /// The key. - /// The value. - /// true if XXXX, false otherwise - private static void TryAdd(Dictionary dictionary, TKey key, TValue value) - { - if (dictionary.ContainsKey(key)) - { - return; - } - - dictionary.Add(key, value); - } - - /// - /// Initializes the specified block unrated. - /// - /// if set to true [block unrated]. - /// Dictionary{System.StringSystem.Int32}. - public static Dictionary Initialize(bool blockUnrated, IServerConfigurationManager configurationManager) - { - //build our ratings dictionary from the combined local one and us one - ratingsDef = new RatingsDefinition(Path.Combine(configurationManager.ApplicationPaths.LocalizationPath, "Ratings-" + configurationManager.Configuration.MetadataCountryCode + ".txt"), configurationManager); - //global value of None - var dict = new Dictionary { { "None", -1 } }; - foreach (var pair in ratingsDef.RatingsDict) - { - TryAdd(dict, pair.Key, pair.Value); - } - if (configurationManager.Configuration.MetadataCountryCode.ToUpper() != "US") - { - foreach (var pair in new USRatingsDictionary()) - { - TryAdd(dict, pair.Key, pair.Value); - } - } - //global values of CS - TryAdd(dict, "CS", 1000); - - TryAdd(dict, "", blockUnrated ? 1000 : 0); - - //and rating reverse lookup dictionary (non-redundant ones) - ratingsStrings.Clear(); - var lastLevel = -10; - ratingsStrings.Add(-1, LocalizedStrings.Instance.GetString("Any")); - foreach (var pair in ratingsDef.RatingsDict.OrderBy(p => p.Value)) - { - if (pair.Value > lastLevel) - { - lastLevel = pair.Value; - TryAdd(ratingsStrings, pair.Value, pair.Key); - } - } - - TryAdd(ratingsStrings, 999, "CS"); - - return dict; - } - - /// - /// Switches the unrated. - /// - /// if set to true [block]. - public static void SwitchUnrated(bool block) - { - RatingsDict.Remove(""); - RatingsDict.Add("", block ? 1000 : 0); - } - - /// - /// Levels the specified rating STR. - /// - /// The rating STR. - /// System.Int32. - public static int Level(string ratingStr) - { - if (ratingStr == null) ratingStr = ""; - if (RatingsDict.ContainsKey(ratingStr)) - return RatingsDict[ratingStr]; - - string stripped = StripCountry(ratingStr); - if (RatingsDict.ContainsKey(stripped)) - return RatingsDict[stripped]; - - return RatingsDict[""]; //return "unknown" level - } - - /// - /// Strips the country. - /// - /// The rating. - /// System.String. - private static string StripCountry(string rating) - { - int start = rating.IndexOf('-'); - return start > 0 ? rating.Substring(start + 1) : rating; - } - - /// - /// Returns a that represents this instance. - /// - /// The level. - /// A that represents this instance. - public static string ToString(int level) - { - //return the closest one - while (level > 0) - { - if (ratingsStrings.ContainsKey(level)) - return ratingsStrings[level]; - - level--; - } - return ratingsStrings.Values.FirstOrDefault(); //default to first one - } - /// - /// To the strings. - /// - /// List{System.String}. - public static List ToStrings() - { - //return the whole list of ratings strings - return ratingsStrings.Values.ToList(); - } - - /// - /// To the values. - /// - /// List{System.Int32}. - public static List ToValues() - { - //return the whole list of ratings values - return ratingsStrings.Keys.ToList(); - } - - //public Microsoft.MediaCenter.UI.Image RatingImage(string rating) - //{ - // return Helper.GetMediaInfoImage("Rated_" + rating); - //} - - - } -} diff --git a/MediaBrowser.Controller/Localization/RatingsDefinition.cs b/MediaBrowser.Controller/Localization/RatingsDefinition.cs deleted file mode 100644 index e5302bee67..0000000000 --- a/MediaBrowser.Controller/Localization/RatingsDefinition.cs +++ /dev/null @@ -1,122 +0,0 @@ -using MediaBrowser.Controller.Configuration; -using System; -using System.Collections.Generic; -using System.IO; - -namespace MediaBrowser.Controller.Localization -{ - /// - /// Class RatingsDefinition - /// - public class RatingsDefinition - { - /// - /// Initializes a new instance of the class. - /// - /// The file. - /// The configuration manager. - public RatingsDefinition(string file, IServerConfigurationManager configurationManager) - { - this.file = file; - if (!Load()) - { - Init(configurationManager.Configuration.MetadataCountryCode.ToUpper()); - } - } - - /// - /// Inits the specified country. - /// - /// The country. - protected void Init(string country) - { - //intitialze based on country - switch (country) - { - case "US": - RatingsDict = new USRatingsDictionary(); - break; - case "GB": - RatingsDict = new GBRatingsDictionary(); - break; - case "NL": - RatingsDict = new NLRatingsDictionary(); - break; - case "AU": - RatingsDict = new AURatingsDictionary(); - break; - default: - RatingsDict = new USRatingsDictionary(); - break; - } - Save(); - } - - /// - /// The file - /// - readonly string file; - - /// - /// Save to file - /// - public void Save() - { - // Use simple text serialization - no need for xml - using (var fs = new StreamWriter(file)) - { - foreach (var pair in RatingsDict) - { - fs.WriteLine(pair.Key + "," + pair.Value); - } - } - } - - /// - /// Load from file - /// - /// true if XXXX, false otherwise - protected bool Load() - { - // Read back in our simple serialized format - RatingsDict = new Dictionary(StringComparer.OrdinalIgnoreCase); - try - { - using (var fs = new StreamReader(file)) - { - while (!fs.EndOfStream) - { - var line = fs.ReadLine() ?? ""; - var values = line.Split(','); - if (values.Length == 2) - { - - int value; - - if (int.TryParse(values[1], out value)) - { - RatingsDict[values[0].Trim()] = value; - } - else - { - //Logger.Error("Invalid line in ratings file " + file + "(" + line + ")"); - } - } - } - } - } - catch - { - // Couldn't load - probably just not there yet - return false; - } - return true; - } - - /// - /// The ratings dict - /// - public Dictionary RatingsDict = new Dictionary(StringComparer.OrdinalIgnoreCase); - - } -} diff --git a/MediaBrowser.Controller/Localization/USRatingsDictionary.cs b/MediaBrowser.Controller/Localization/USRatingsDictionary.cs deleted file mode 100644 index 2c7a69841c..0000000000 --- a/MediaBrowser.Controller/Localization/USRatingsDictionary.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Collections.Generic; - -namespace MediaBrowser.Controller.Localization -{ - /// - /// Class USRatingsDictionary - /// - public class USRatingsDictionary : Dictionary - { - /// - /// Initializes a new instance of the class. - /// - public USRatingsDictionary() - { - Add("G", 1); - Add("E", 1); - Add("EC", 1); - Add("TV-G", 1); - Add("TV-Y", 2); - Add("TV-Y7", 3); - Add("TV-Y7-FV", 4); - Add("PG", 5); - Add("TV-PG", 5); - Add("PG-13", 7); - Add("T", 7); - Add("TV-14", 8); - Add("R", 9); - Add("M", 9); - Add("TV-MA", 9); - Add("NC-17", 10); - Add("AO", 15); - Add("RP", 15); - Add("UR", 15); - Add("NR", 15); - Add("X", 15); - Add("XXX", 100); - } - } -} diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 1e2a095ce9..96989f5687 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -131,15 +131,9 @@ - - - - - - diff --git a/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs b/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs index 8705d912f9..1965531af9 100644 --- a/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs +++ b/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs @@ -1,10 +1,15 @@ -using MediaBrowser.Controller.Localization; +using MediaBrowser.Common.IO; +using MediaBrowser.Controller.Configuration; +using MediaBrowser.Controller.Localization; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Globalization; using MoreLinq; +using System; using System.Collections.Generic; using System.Globalization; +using System.IO; using System.Linq; +using System.Threading.Tasks; namespace MediaBrowser.Server.Implementations.Localization { @@ -13,6 +18,37 @@ namespace MediaBrowser.Server.Implementations.Localization /// public class LocalizationManager : ILocalizationManager { + /// + /// The _configuration manager + /// + private readonly IServerConfigurationManager _configurationManager; + + /// + /// The us culture + /// + private static readonly CultureInfo UsCulture = new CultureInfo("en-US"); + + /// + /// Initializes a new instance of the class. + /// + /// The configuration manager. + public LocalizationManager(IServerConfigurationManager configurationManager) + { + _configurationManager = configurationManager; + } + + /// + /// Gets the localization path. + /// + /// The localization path. + public string LocalizationPath + { + get + { + return Path.Combine(_configurationManager.ApplicationPaths.ProgramDataPath, "localization"); + } + } + /// /// Gets the cultures. /// @@ -56,10 +92,125 @@ namespace MediaBrowser.Server.Implementations.Localization /// IEnumerable{ParentalRating}. public IEnumerable GetParentalRatings() { - return Ratings.RatingsDict - .Select(k => new ParentalRating {Name = k.Key, Value = k.Value}) - .OrderBy(p => p.Value) - .Where(p => p.Value > 0); + var path = GetRatingsFile(); + + return File.ReadAllLines(path).Select(i => + { + if (!string.IsNullOrWhiteSpace(i)) + { + var parts = i.Split(','); + + if (parts.Length == 2) + { + int value; + + if (int.TryParse(parts[1], NumberStyles.Integer, UsCulture, out value)) + { + return new ParentalRating { Name = parts[0], Value = value }; + } + } + } + + return null; + + }) + .Where(i => i != null) + .OrderBy(p => p.Value); + } + + /// + /// Gets the ratings file. + /// + /// System.String. + private string GetRatingsFile() + { + var countryCode = _configurationManager.Configuration.MetadataCountryCode; + + if (string.IsNullOrEmpty(countryCode)) + { + countryCode = "us"; + } + + return GetRatingsFile(countryCode).Result ?? GetRatingsFile("us").Result; + } + + /// + /// Gets the ratings file. + /// + /// The country code. + /// Task{System.String}. + private async Task GetRatingsFile(string countryCode) + { + countryCode = countryCode.ToLower(); + + var path = Path.Combine(LocalizationPath, "ratings-" + countryCode + ".txt"); + + if (!File.Exists(path)) + { + // Extract embedded resource + + var type = GetType(); + var resourcePath = type.Namespace + ".Ratings." + countryCode + ".txt"; + + using (var stream = type.Assembly.GetManifestResourceStream(resourcePath)) + { + if (stream == null) + { + return null; + } + + var parentPath = Path.GetDirectoryName(path); + + if (!Directory.Exists(parentPath)) + { + Directory.CreateDirectory(parentPath); + } + + using (var fs = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read, StreamDefaults.DefaultFileStreamBufferSize, true)) + { + await stream.CopyToAsync(fs).ConfigureAwait(false); + } + } + } + + return path; + } + + /// + /// Gets the rating level. + /// + /// The rating. + /// System.Int32. + /// rating + public int? GetRatingLevel(string rating) + { + if (string.IsNullOrEmpty(rating)) + { + throw new ArgumentNullException("rating"); + } + + var ratingsDictionary = GetParentalRatings().ToDictionary(i => i.Name); + + if (ratingsDictionary.ContainsKey(rating)) + return ratingsDictionary[rating].Value; + + var stripped = StripCountry(rating); + + if (ratingsDictionary.ContainsKey(stripped)) + return ratingsDictionary[stripped].Value; + + return null; + } + + /// + /// Strips the country. + /// + /// The rating. + /// System.String. + private static string StripCountry(string rating) + { + int start = rating.IndexOf('-'); + return start > 0 ? rating.Substring(start + 1) : rating; } } } diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/au.txt b/MediaBrowser.Server.Implementations/Localization/Ratings/au.txt new file mode 100644 index 0000000000..a68a3f5f3f --- /dev/null +++ b/MediaBrowser.Server.Implementations/Localization/Ratings/au.txt @@ -0,0 +1,6 @@ +AU-G,1 +AU-PG,5 +AU-M,6 +AU-M15+,8 +AU-R18+,9 +AU-X18+,10 \ No newline at end of file diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/gb.txt b/MediaBrowser.Server.Implementations/Localization/Ratings/gb.txt new file mode 100644 index 0000000000..91d9c87cd3 --- /dev/null +++ b/MediaBrowser.Server.Implementations/Localization/Ratings/gb.txt @@ -0,0 +1,7 @@ +GB-U,1 +GB-PG,5 +GB-12,6 +GB-12A,7 +GB-15,8 +GB-18,9 +GB-R18,15 \ No newline at end of file diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/nl.txt b/MediaBrowser.Server.Implementations/Localization/Ratings/nl.txt new file mode 100644 index 0000000000..f69cc2bcc9 --- /dev/null +++ b/MediaBrowser.Server.Implementations/Localization/Ratings/nl.txt @@ -0,0 +1,6 @@ +NL-AL,1 +NL-MG6,2 +NL-6,3 +NL-9,5 +NL-12,6 +NL-16,8 \ No newline at end of file diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/us.txt b/MediaBrowser.Server.Implementations/Localization/Ratings/us.txt new file mode 100644 index 0000000000..3f5311e0ea --- /dev/null +++ b/MediaBrowser.Server.Implementations/Localization/Ratings/us.txt @@ -0,0 +1,22 @@ +G,1 +E,1 +EC,1 +TV-G,1 +TV-Y,2 +TV-Y7,3 +TV-Y7-FV,4 +PG,5 +TV-PG,5 +PG-13,7 +T,7 +TV-14,8 +R,9 +M,9 +TV-MA,9 +NC-17,10 +AO,15 +RP,15 +UR,15 +NR,15 +X,15 +XXX,100 \ No newline at end of file diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj index 60afc8413d..869fc16860 100644 --- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj +++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj @@ -204,6 +204,10 @@ + + + + PreserveNewest diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index 80f63df367..583053fa4e 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -172,6 +172,8 @@ namespace MediaBrowser.ServerApplication /// The media encoder. private IMediaEncoder MediaEncoder { get; set; } + private ILocalizationManager LocalizationManager { get; set; } + /// /// Gets or sets the user data repository. /// @@ -286,8 +288,8 @@ namespace MediaBrowser.ServerApplication ServerManager = new ServerManager(this, JsonSerializer, Logger, ServerConfigurationManager); RegisterSingleInstance(ServerManager); - var localizationManager = new LocalizationManager(); - RegisterSingleInstance(localizationManager); + LocalizationManager = new LocalizationManager(ServerConfigurationManager); + RegisterSingleInstance(LocalizationManager); var displayPreferencesTask = Task.Run(async () => await ConfigureDisplayPreferencesRepositories().ConfigureAwait(false)); var itemsTask = Task.Run(async () => await ConfigureItemRepositories().ConfigureAwait(false)); @@ -367,9 +369,9 @@ namespace MediaBrowser.ServerApplication BaseItem.ConfigurationManager = ServerConfigurationManager; BaseItem.LibraryManager = LibraryManager; BaseItem.ProviderManager = ProviderManager; + BaseItem.LocalizationManager = LocalizationManager; User.XmlSerializer = XmlSerializer; User.UserManager = UserManager; - Ratings.ConfigurationManager = ServerConfigurationManager; LocalizedStrings.ApplicationPaths = ApplicationPaths; }