using System.Collections.Generic; using System.Globalization; using System.Reflection; namespace Jellyfin.Plugin.Simkl.API.Objects { /// /// Simkl Ids. /// public class SimklIds { /// /// Initializes a new instance of the class. /// /// The provider ids. public SimklIds(Dictionary providerIds) { foreach (var (key, value) in providerIds) { var prop = GetType().GetProperty(key, BindingFlags.IgnoreCase); if (prop.PropertyType == typeof(int?)) { prop.SetValue(this, int.Parse(value, NumberStyles.Any, CultureInfo.InvariantCulture)); } else if (prop.PropertyType == typeof(string)) { prop.SetValue(this, value); } } } /// /// Gets or sets simkl. /// public int? Simkl { get; set; } /// /// Gets or sets the imdb id. /// public string Imdb { get; set; } /// /// Gets or sets the slug. /// public string Slug { get; set; } /// /// Gets or sets the netflix id. /// public string Netflix { get; set; } /// /// Gets or sets the TMDb id. /// public string Tmdb { get; set; } } }