using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Jellyfin.Data.Interfaces; namespace Jellyfin.Data.Entities.Libraries { /// /// This is the entity to store review ratings, not age ratings. /// public class RatingSource : IHasConcurrencyToken { /// /// Initializes a new instance of the class. /// /// The minimum value. /// The maximum value. public RatingSource(double minimumValue, double maximumValue) { MinimumValue = minimumValue; MaximumValue = maximumValue; } /// /// Gets the id. /// /// /// Identity, Indexed, Required. /// [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; private set; } /// /// Gets or sets the name. /// /// /// Max length = 1024. /// [MaxLength(1024)] [StringLength(1024)] public string? Name { get; set; } /// /// Gets or sets the minimum value. /// /// /// Required. /// public double MinimumValue { get; set; } /// /// Gets or sets the maximum value. /// /// /// Required. /// public double MaximumValue { get; set; } /// [ConcurrencyCheck] public uint RowVersion { get; private set; } /// /// Gets or sets the metadata source. /// public virtual MetadataProviderId? Source { get; set; } /// public void OnSavingChanges() { RowVersion++; } } }