Possibly fix issues

After doing testing with a test project, re-organized code to new method
of storing, as well as ensure that all Endpoint lambda's are separated
out into functions.

Large commit, will be testing.
This commit is contained in:
Mario Steele 2025-08-08 16:59:29 -05:00
parent 2e4f644c17
commit 73955353cb
23 changed files with 314 additions and 352 deletions

View file

@ -1,4 +1,4 @@
namespace FreeTubeSync.Model.Database;
namespace FreeTubeSync.Model;
public class ChangeLog
{

View file

@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;
namespace FreeTubeSync.Model.Database;
namespace FreeTubeSync.Model;
public class History
{

View file

@ -1,23 +0,0 @@
using System.Diagnostics.CodeAnalysis;
namespace FreeTubeSync.Model.Json;
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class HistoryJson
{
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

@ -1,14 +0,0 @@
using System.Diagnostics.CodeAnalysis;
namespace FreeTubeSync.Model.Json;
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class PlaylistJson
{
public string _id { get; set; } = string.Empty;
public string playlistName { get; set; } = string.Empty;
public bool @protected { get; set; }
public List<VideoJson> videos { get; set; } = [];
public long createdAt { get; set; }
public long lastUpdatedAt { get; set; }
}

View file

@ -1,13 +0,0 @@
using System.Diagnostics.CodeAnalysis;
namespace FreeTubeSync.Model.Json;
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class ProfileJson
{
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<SubscriptionJson> subscriptions { get; set; } = [];
}

View file

@ -1,10 +0,0 @@
using System.Diagnostics.CodeAnalysis;
namespace FreeTubeSync.Model.Json;
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class SearchHistoryJson
{
public string _id { get; set; } = string.Empty;
public long lastUpdatedAt { get; set; }
}

View file

@ -1,10 +0,0 @@
using System.Diagnostics.CodeAnalysis;
namespace FreeTubeSync.Model.Json;
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class SettingJson
{
public string _id { get; set; } = string.Empty;
public string value { get; set; }
}

View file

@ -1,11 +0,0 @@
using System.Diagnostics.CodeAnalysis;
namespace FreeTubeSync.Model.Json;
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class SubscriptionJson
{
public string id { get; set; } = string.Empty;
public string name { get; set; } = string.Empty;
public string? thumbnail { get; set; }
}

View file

@ -1,18 +0,0 @@
using System.Diagnostics.CodeAnalysis;
namespace FreeTubeSync.Model.Json;
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class VideoJson
{
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; }
public string playlistItemId { get; set; } = string.Empty;
public string type { get; set; } = string.Empty;
}

View file

@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;
namespace FreeTubeSync.Model.Database;
namespace FreeTubeSync.Model;
public class Playlist
{

View file

@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;
namespace FreeTubeSync.Model.Database;
namespace FreeTubeSync.Model;
public class Profile
{

View file

@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;
namespace FreeTubeSync.Model.Database;
namespace FreeTubeSync.Model;
public class SearchHistory
{

View file

@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;
namespace FreeTubeSync.Model.Database;
namespace FreeTubeSync.Model;
public class Setting
{

View file

@ -1,10 +1,10 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
namespace FreeTubeSync.Model.Database;
namespace FreeTubeSync.Model;
[Owned]
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

@ -1,7 +1,8 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
namespace FreeTubeSync.Model.Database;
namespace FreeTubeSync.Model;
[Owned]
public class Video
{
public string videoId { get; set; } = string.Empty;
@ -9,9 +10,8 @@ public class Video
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 published { get; set; }
public long timeAdded { get; set; }
[Key]
public string playlistItemId { get; set; } = string.Empty;
public string type { get; set; } = string.Empty;
}