Shadowghost 6e7118eff1 Backport pull request #12934 from jellyfin/release-10.10.z
Fix playlists

Original-merge: 8bee67f1f8dab604d745b3d077330085f7f111d4

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
2024-11-19 15:43:18 -05:00

46 lines
985 B
C#

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