mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
Fix playlists Original-merge: 8bee67f1f8dab604d745b3d077330085f7f111d4 Merged-by: crobibero <cody@robibe.ro> Backported-by: Joshua M. Boniface <joshua@boniface.me>
46 lines
985 B
C#
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;
|
|
}
|
|
}
|
|
}
|