2025-07-19 04:02:09 -05:00
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
|
|
|
|
|
|
namespace FreeTubeSync.Model;
|
|
|
|
|
|
|
|
|
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
|
|
|
|
public class Playlist
|
|
|
|
|
{
|
|
|
|
|
[Key]
|
|
|
|
|
public string _id { get; set; } = string.Empty;
|
|
|
|
|
public string playlistName { get; set; } = string.Empty;
|
|
|
|
|
public bool @protected { get; set; }
|
|
|
|
|
public List<Video> videos { get; set; } = [];
|
2025-07-19 12:41:50 -05:00
|
|
|
public long createdAt { get; set; }
|
|
|
|
|
public long lastUpdatedAt { get; set; }
|
2025-07-19 04:02:09 -05:00
|
|
|
|
|
|
|
|
public void Update(Playlist other)
|
|
|
|
|
{
|
|
|
|
|
if (other.playlistName != playlistName) playlistName = other.playlistName;
|
|
|
|
|
if (other.@protected != @protected) @protected = other.@protected;
|
|
|
|
|
if (other.videos.Count != videos.Count) videos = other.videos;
|
|
|
|
|
if (other.createdAt != createdAt) createdAt = other.createdAt;
|
|
|
|
|
if (other.lastUpdatedAt != lastUpdatedAt) lastUpdatedAt = other.lastUpdatedAt;
|
|
|
|
|
}
|
|
|
|
|
}
|