You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/MediaBrowser.Controller/Entities/LinkedChild.cs

49 lines
1.1 KiB

#nullable disable
#pragma warning disable CS1591
using System;
using System.Globalization;
using System.Text.Json.Serialization;
6 years ago
namespace MediaBrowser.Controller.Entities
{
public class LinkedChild
{
public LinkedChild()
{
Id = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
}
6 years ago
public string Path { get; set; }
6 years ago
public LinkedChildType Type { get; set; }
6 years ago
public string LibraryItemId { get; set; }
[JsonIgnore]
6 years ago
public string Id { get; set; }
/// <summary>
/// Gets or sets the linked item id.
6 years ago
/// </summary>
public Guid? ItemId { get; set; }
public static LinkedChild Create(BaseItem item)
{
var child = new LinkedChild
{
Path = item.Path,
Type = LinkedChildType.Manual
};
if (string.IsNullOrEmpty(child.Path))
{
child.LibraryItemId = item.Id.ToString("N", CultureInfo.InvariantCulture);
6 years ago
}
return child;
}
}
}