Started the Split
Split Json data models coming from REST Api, from the Database models storing them in a SQLite database. Work to re-engineer endpoints to use Database objects, and copy/update data from the json objects. More work is needed.
This commit is contained in:
parent
157d46ee2e
commit
4985dc4179
36 changed files with 684 additions and 323 deletions
|
|
@ -1,43 +0,0 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace FreeTubeSync.Model;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class History
|
||||
{
|
||||
[Key]
|
||||
public string _id { get; set; } = string.Empty;
|
||||
public string videoId { get; set; } = string.Empty;
|
||||
public string title { get; set; } = string.Empty;
|
||||
public string author { get; set; } = string.Empty;
|
||||
public string authorId { get; set; } = string.Empty;
|
||||
public long published { get; set; }
|
||||
public string description { get; set; } = string.Empty;
|
||||
public long viewCount { get; set; }
|
||||
public long lengthSeconds { get; set; }
|
||||
public float watchProgress { get; set; }
|
||||
public long timeWatched { get; set; }
|
||||
public bool isLive { get; set; }
|
||||
public string type { get; set; } = string.Empty;
|
||||
public string lastViewedPlaylistType { get; set; } = string.Empty;
|
||||
public string? lastViewedPlaylistItemId { get; set; }
|
||||
|
||||
public void Update(History other)
|
||||
{
|
||||
if (other.videoId != videoId) videoId = other.videoId;
|
||||
if (other.title != title) title = other.title;
|
||||
if (other.author != author) author = other.author;
|
||||
if (other.authorId != authorId) authorId = other.authorId;
|
||||
if (other.published != published) published = other.published;
|
||||
if (other.description != description) description = other.description;
|
||||
if (other.viewCount != viewCount) viewCount = other.viewCount;
|
||||
if (other.lengthSeconds != lengthSeconds) lengthSeconds = other.lengthSeconds;
|
||||
if (!other.watchProgress.Equals(watchProgress)) watchProgress = other.watchProgress;
|
||||
if (other.timeWatched != timeWatched) timeWatched = other.timeWatched;
|
||||
if (other.isLive != isLive) isLive = other.isLive;
|
||||
if (other.type != type) type = other.type;
|
||||
if (other.lastViewedPlaylistType != lastViewedPlaylistType) lastViewedPlaylistType = other.lastViewedPlaylistType;
|
||||
if (other.lastViewedPlaylistItemId != lastViewedPlaylistItemId) lastViewedPlaylistItemId = other.lastViewedPlaylistItemId;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue