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:
Mario Steele 2025-07-22 17:03:33 -05:00
parent 157d46ee2e
commit 4985dc4179
36 changed files with 684 additions and 323 deletions

View file

@ -0,0 +1,23 @@
using System.ComponentModel.DataAnnotations;
namespace FreeTubeSync.Model.Database;
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; }
}

View file

@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
namespace FreeTubeSync.Model.Database;
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; } = [];
public long createdAt { get; set; }
public long lastUpdatedAt { get; set; }
}

View file

@ -0,0 +1,13 @@
using System.ComponentModel.DataAnnotations;
namespace FreeTubeSync.Model.Database;
public class Profile
{
[Key]
public string _id { get; set; } = string.Empty;
public string name { get; set; } = string.Empty;
public string bgColor { get; set; } = string.Empty;
public string textColor { get; set; } = string.Empty;
public List<Subscription> subscriptions { get; set; } = [];
}

View file

@ -0,0 +1,10 @@
using System.ComponentModel.DataAnnotations;
namespace FreeTubeSync.Model.Database;
public class SearchHistory
{
[Key]
public string _id { get; set; } = string.Empty;
public long lastUpdatedAt { get; set; }
}

View file

@ -0,0 +1,10 @@
using System.ComponentModel.DataAnnotations;
namespace FreeTubeSync.Model.Database;
public class Setting
{
[Key]
public string _id { get; set; }
public string value { get; set; }
}

View file

@ -0,0 +1,11 @@
using System.ComponentModel.DataAnnotations;
namespace FreeTubeSync.Model.Database;
public class Subscription
{
[Key]
public string id { get; set; } = string.Empty;
public string name { get; set; } = string.Empty;
public string? thumbnail { get; set; }
}

View file

@ -0,0 +1,17 @@
using System.ComponentModel.DataAnnotations;
namespace FreeTubeSync.Model.Database;
public class Video
{
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 string lengthSeconds { get; set; } = string.Empty;
public long pubished { get; set; }
public long timeAdded { get; set; }
[Key]
public string playlistItemId { get; set; } = string.Empty;
public string type { get; set; } = string.Empty;
}