28 lines
909 B
C#
28 lines
909 B
C#
using System.Runtime.Serialization;
|
|
namespace Jellyfin.Plugin.SmartPlaylist {
|
|
[Serializable]
|
|
public class SmartPlaylistDto {
|
|
private string DEFAULT_PROGRAM = "(begin (invoke item 'IsFavoriteOrLiked' (user)))";
|
|
public SmartPlaylistId Id { get; set; }
|
|
public string? Name { get; set; }
|
|
public UserId User { get; set; }
|
|
public string? Program { get; set; }
|
|
public string? Filename { get; set; }
|
|
public int MaxItems { get; set; } = -1;
|
|
|
|
public void Fill(string filename) {
|
|
if (Id == Guid.Empty) {
|
|
Id = Guid.NewGuid();
|
|
}
|
|
if (Name == null) {
|
|
Name = Id.ToString();
|
|
}
|
|
if (Program == null) {
|
|
Program = DEFAULT_PROGRAM;
|
|
}
|
|
if (Filename == null) {
|
|
Filename = filename;
|
|
}
|
|
}
|
|
}
|
|
}
|