2024-10-25 02:18:13 +02:00
|
|
|
using System.Runtime.Serialization;
|
2024-10-24 23:53:21 +02:00
|
|
|
namespace Jellyfin.Plugin.SmartPlaylist {
|
|
|
|
[Serializable]
|
|
|
|
public class SmartPlaylistDto {
|
2024-10-25 02:18:13 +02:00
|
|
|
private string DEFAULT_PROGRAM = "(begin (invoke item 'IsFavoriteOrLiked' (user)))";
|
2024-10-24 23:53:21 +02:00
|
|
|
public SmartPlaylistId Id { get; set; }
|
2024-10-25 02:18:13 +02:00
|
|
|
public string? Name { get; set; }
|
2024-10-24 23:53:21 +02:00
|
|
|
public UserId User { get; set; }
|
2024-10-25 02:18:13 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
2024-10-24 23:53:21 +02:00
|
|
|
}
|
|
|
|
}
|