mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-20 14:00:35 -04:00
53 lines
1.4 KiB
C#
53 lines
1.4 KiB
C#
using System;
|
|
using System.Linq.Expressions;
|
|
using Kyoo.Models.Attributes;
|
|
|
|
namespace Kyoo.Models
|
|
{
|
|
/// <summary>
|
|
/// ID and link of an item on an external provider.
|
|
/// </summary>
|
|
public class MetadataID
|
|
{
|
|
/// <summary>
|
|
/// The ID of the resource which possess the metadata.
|
|
/// </summary>
|
|
[SerializeIgnore] public int ResourceID { get; set; }
|
|
|
|
/// <summary>
|
|
/// The name of the resource type. This is only used internally to discriminate types.
|
|
/// </summary>
|
|
[SerializeIgnore] public string ResourceType { get; set; }
|
|
|
|
/// <summary>
|
|
/// The ID of the provider.
|
|
/// </summary>
|
|
[SerializeIgnore] public int ProviderID { get; set; }
|
|
|
|
/// <summary>
|
|
/// The provider that can do something with this ID.
|
|
/// </summary>
|
|
public Provider Provider { get; set; }
|
|
|
|
/// <summary>
|
|
/// The ID of the resource on the external provider.
|
|
/// </summary>
|
|
public string DataID { get; set; }
|
|
|
|
/// <summary>
|
|
/// The URL of the resource on the external provider.
|
|
/// </summary>
|
|
public string Link { get; set; }
|
|
|
|
/// <summary>
|
|
/// The expression to retrieve the unique ID of a MetadataID. This is an aggregate of the two resources IDs.
|
|
/// </summary>
|
|
public static Expression<Func<MetadataID, object>> PrimaryKey
|
|
{
|
|
get
|
|
{
|
|
return x => new {First = x.ResourceID, Second = x.ProviderID, Type = x.ResourceType};
|
|
}
|
|
}
|
|
}
|
|
} |