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
23
FreeTubeSync/Model/Database/History.cs
Normal file
23
FreeTubeSync/Model/Database/History.cs
Normal 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; }
|
||||
}
|
||||
14
FreeTubeSync/Model/Database/Playlist.cs
Normal file
14
FreeTubeSync/Model/Database/Playlist.cs
Normal 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; }
|
||||
}
|
||||
13
FreeTubeSync/Model/Database/Profile.cs
Normal file
13
FreeTubeSync/Model/Database/Profile.cs
Normal 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; } = [];
|
||||
}
|
||||
10
FreeTubeSync/Model/Database/SearchHistory.cs
Normal file
10
FreeTubeSync/Model/Database/SearchHistory.cs
Normal 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; }
|
||||
}
|
||||
10
FreeTubeSync/Model/Database/Setting.cs
Normal file
10
FreeTubeSync/Model/Database/Setting.cs
Normal 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; }
|
||||
}
|
||||
11
FreeTubeSync/Model/Database/Subscription.cs
Normal file
11
FreeTubeSync/Model/Database/Subscription.cs
Normal 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; }
|
||||
}
|
||||
17
FreeTubeSync/Model/Database/Video.cs
Normal file
17
FreeTubeSync/Model/Database/Video.cs
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue