diff --git a/HarmonyDB and OneShelf.sln b/HarmonyDB and OneShelf.sln index 7f0f4ce5..91a815cf 100644 --- a/HarmonyDB and OneShelf.sln +++ b/HarmonyDB and OneShelf.sln @@ -191,23 +191,25 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OneShelf.Telegram", "OneShe EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OneShelf.OneDragon", "OneShelf.OneDragon", "{950D96F8-860E-4EE6-A8EC-8ECCC6BE480F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneShelf.OneDragon.Runner.Functions", "OneShelf.OneDragon\OneShelf.OneDragon.Runner.Functions\OneShelf.OneDragon.Runner.Functions.csproj", "{4A7E75E5-B345-4BF8-BFCC-788ADC1FA218}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OneShelf.OneDragon.Runner.Functions", "OneShelf.OneDragon\OneShelf.OneDragon.Runner.Functions\OneShelf.OneDragon.Runner.Functions.csproj", "{4A7E75E5-B345-4BF8-BFCC-788ADC1FA218}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneShelf.OneDragon.Processor", "OneShelf.OneDragon\OneShelf.OneDragon.Processor\OneShelf.OneDragon.Processor.csproj", "{DF960A56-A097-4220-A8FE-B9714680F87D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OneShelf.OneDragon.Processor", "OneShelf.OneDragon\OneShelf.OneDragon.Processor\OneShelf.OneDragon.Processor.csproj", "{DF960A56-A097-4220-A8FE-B9714680F87D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneShelf.OneDragon.Database", "OneShelf.OneDragon\OneShelf.OneDragon.Database\OneShelf.OneDragon.Database.csproj", "{8DB5C0DC-C738-4CC4-A281-392A65ED4743}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OneShelf.OneDragon.Database", "OneShelf.OneDragon\OneShelf.OneDragon.Database\OneShelf.OneDragon.Database.csproj", "{8DB5C0DC-C738-4CC4-A281-392A65ED4743}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneShelf.Telegram.Polling", "OneShelf.Telegram\OneShelf.Telegram.Polling\OneShelf.Telegram.Polling.csproj", "{76C5E207-6028-4083-84C5-DAC7839D1F85}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OneShelf.Telegram.Polling", "OneShelf.Telegram\OneShelf.Telegram.Polling\OneShelf.Telegram.Polling.csproj", "{76C5E207-6028-4083-84C5-DAC7839D1F85}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OneShelf.TelegramLibrary", "OneShelf.TelegramLibrary", "{FE163498-92F2-4216-B757-BFA3C3C6C0D8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneShelf.Telegram.Ai", "OneShelf.Telegram\OneShelf.Telegram.Ai\OneShelf.Telegram.Ai.csproj", "{DAFCA5B8-2C80-4519-8E4A-3E5958E2A37E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OneShelf.Telegram.Ai", "OneShelf.Telegram\OneShelf.Telegram.Ai\OneShelf.Telegram.Ai.csproj", "{DAFCA5B8-2C80-4519-8E4A-3E5958E2A37E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneShelf.Telegram.Ai.Model", "OneShelf.Telegram\OneShelf.Telegram.Ai.Model\OneShelf.Telegram.Ai.Model.csproj", "{DC7B80CC-E597-4E67-9FFB-33DB252EC321}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OneShelf.Telegram.Ai.Model", "OneShelf.Telegram\OneShelf.Telegram.Ai.Model\OneShelf.Telegram.Ai.Model.csproj", "{DC7B80CC-E597-4E67-9FFB-33DB252EC321}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OneShelf.Videos", "OneShelf.Videos", "{5F839A7C-B540-4475-9FFE-9E5E4FC10D78}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneShelf.Videos.App", "OneShelf.Videos\OneShelf.Videos.App\OneShelf.Videos.App.csproj", "{99134E7C-CE2F-4641-A9E3-B961F76307F0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OneShelf.Videos.App", "OneShelf.Videos\OneShelf.Videos.App\OneShelf.Videos.App.csproj", "{99134E7C-CE2F-4641-A9E3-B961F76307F0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneShelf.Videos.Database", "OneShelf.Videos\OneShelf.Videos.Database\OneShelf.Videos.Database.csproj", "{D702C117-2C9A-44E0-B428-30371616FBAE}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -515,6 +517,10 @@ Global {99134E7C-CE2F-4641-A9E3-B961F76307F0}.Debug|Any CPU.Build.0 = Debug|Any CPU {99134E7C-CE2F-4641-A9E3-B961F76307F0}.Release|Any CPU.ActiveCfg = Release|Any CPU {99134E7C-CE2F-4641-A9E3-B961F76307F0}.Release|Any CPU.Build.0 = Release|Any CPU + {D702C117-2C9A-44E0-B428-30371616FBAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D702C117-2C9A-44E0-B428-30371616FBAE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D702C117-2C9A-44E0-B428-30371616FBAE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D702C117-2C9A-44E0-B428-30371616FBAE}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -596,6 +602,7 @@ Global {DAFCA5B8-2C80-4519-8E4A-3E5958E2A37E} = {95E2976B-C1F3-47B9-98F5-741E9D21CC68} {DC7B80CC-E597-4E67-9FFB-33DB252EC321} = {95E2976B-C1F3-47B9-98F5-741E9D21CC68} {99134E7C-CE2F-4641-A9E3-B961F76307F0} = {5F839A7C-B540-4475-9FFE-9E5E4FC10D78} + {D702C117-2C9A-44E0-B428-30371616FBAE} = {5F839A7C-B540-4475-9FFE-9E5E4FC10D78} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {59093261-FDDA-411A-852D-EA21AEF83E07} diff --git a/OneShelf.Videos/OneShelf.Videos.App/OneShelf.Videos.App.csproj b/OneShelf.Videos/OneShelf.Videos.App/OneShelf.Videos.App.csproj index d352105e..8ef94d20 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/OneShelf.Videos.App.csproj +++ b/OneShelf.Videos/OneShelf.Videos.App/OneShelf.Videos.App.csproj @@ -11,17 +11,16 @@ - all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/OneShelf.Videos/OneShelf.Videos.App/Program.cs b/OneShelf.Videos/OneShelf.Videos.App/Program.cs index c8b5c282..30639994 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Program.cs +++ b/OneShelf.Videos/OneShelf.Videos.App/Program.cs @@ -2,10 +2,10 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using OneShelf.Videos.App.Database; using OneShelf.Videos.App.Models; using OneShelf.Videos.App.Services; using OneShelf.Videos.App.UpdatedGooglePhotosService; +using OneShelf.Videos.Database; var builder = Host.CreateApplicationBuilder(); builder.Configuration.AddJsonFile("appsettings.Secrets.json"); @@ -14,7 +14,8 @@ .AddScoped() .AddScoped() .AddScoped() - .AddDbContext(o => o.UseSqlServer(builder.Configuration.GetConnectionString(nameof(VideosDatabase)))) + .AddScoped() + .AddVideosDatabase(builder.Configuration) .AddMyGooglePhotos(); var host = builder.Build(); @@ -46,4 +47,4 @@ //await service2.UploadPhotos((await service1.GetExport1()).OrderBy(_ => Random.Shared.NextDouble()).ToList()); //await service2.UploadVideos((await service1.GetExport2()).OrderBy(_ => Random.Shared.NextDouble()).ToList()); -//await service2.CreateAlbums(await service1.GetAlbums()); \ No newline at end of file +await service2.CreateAlbums(await service1.GetAlbums()); \ No newline at end of file diff --git a/OneShelf.Videos/OneShelf.Videos.App/Services/Service1.cs b/OneShelf.Videos/OneShelf.Videos.App/Services/Service1.cs index ec50a9d3..7440f80c 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Services/Service1.cs +++ b/OneShelf.Videos/OneShelf.Videos.App/Services/Service1.cs @@ -7,11 +7,10 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using OneShelf.Common; -using OneShelf.Videos.App.Database; -using OneShelf.Videos.App.Database.Models; -using OneShelf.Videos.App.Database.Models.Enums; -using OneShelf.Videos.App.Database.Models.Json; using OneShelf.Videos.App.Models; +using OneShelf.Videos.Database; +using OneShelf.Videos.Database.Models.Enums; +using OneShelf.Videos.Database.Models.Json; namespace OneShelf.Videos.App.Services; diff --git a/OneShelf.Videos/OneShelf.Videos.App/Services/Service2.cs b/OneShelf.Videos/OneShelf.Videos.App/Services/Service2.cs index 917b5a77..df6d6ad7 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Services/Service2.cs +++ b/OneShelf.Videos/OneShelf.Videos.App/Services/Service2.cs @@ -2,8 +2,8 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using OneShelf.Common; -using OneShelf.Videos.App.Database; -using OneShelf.Videos.App.Database.Models; +using OneShelf.Videos.Database; +using OneShelf.Videos.Database.Models; namespace OneShelf.Videos.App.Services; @@ -12,14 +12,16 @@ public class Service2 private readonly UpdatedGooglePhotosService.UpdatedGooglePhotosService _googlePhotosService; private readonly ILogger _logger; private readonly VideosDatabase _videosDatabase; + private readonly VideosDatabaseOperations _videosDatabaseOperations; private readonly Service3 _service3; - public Service2(UpdatedGooglePhotosService.UpdatedGooglePhotosService googlePhotosService, ILogger logger, VideosDatabase videosDatabase, Service3 service3) + public Service2(UpdatedGooglePhotosService.UpdatedGooglePhotosService googlePhotosService, ILogger logger, VideosDatabase videosDatabase, Service3 service3, VideosDatabaseOperations videosDatabaseOperations) { _googlePhotosService = googlePhotosService; _logger = logger; _videosDatabase = videosDatabase; _service3 = service3; + _videosDatabaseOperations = videosDatabaseOperations; } public async Task SaveInventory() @@ -121,7 +123,7 @@ private async Task AddToDatabase( Dictionary<(long chatId, int messageId), NewMediaItemResult> newItems, Dictionary<(long chatId, int messageId), DateTime>? fileNameTimestamps = null) { - _videosDatabase.AddItems(newItems.Select(i => items[i.Key].SelectSingle(x => (x.chatId, x.messageId, x.path, x.publishedOn, result: i.Value, fileNameTimestamp: fileNameTimestamps?[i.Key])))); + _videosDatabaseOperations.AddItems(newItems.Select(i => items[i.Key].SelectSingle(x => (x.chatId, x.messageId, x.path, x.publishedOn, result: i.Value, fileNameTimestamp: fileNameTimestamps?[i.Key])))); await _videosDatabase.SaveChangesAsync(); } diff --git a/OneShelf.Videos/OneShelf.Videos.App/Services/VideosDatabaseOperations.cs b/OneShelf.Videos/OneShelf.Videos.App/Services/VideosDatabaseOperations.cs new file mode 100644 index 00000000..08e860a5 --- /dev/null +++ b/OneShelf.Videos/OneShelf.Videos.App/Services/VideosDatabaseOperations.cs @@ -0,0 +1,31 @@ +using System.Text.Json; +using CasCap.Models; +using OneShelf.Videos.Database; +using OneShelf.Videos.Database.Models; + +namespace OneShelf.Videos.App.Services; + +public class VideosDatabaseOperations(VideosDatabase videosDatabase) +{ + public void AddItems(IEnumerable<(long chatId, int messageId, string path, DateTime publishedOn, NewMediaItemResult result, DateTime? fileNameTimestamp)> items) + { + videosDatabase.UploadedItems.AddRange(items.Select(i => new UploadedItem + { + CreatedOn = DateTime.Now, + ChatId = i.chatId, + MessageId = i.messageId, + TelegramPublishedOn = i.publishedOn, + Status = i.result.status.status, + StatusCode = i.result.status.code, + StatusMessage = i.result.status.message, + MediaItemId = i.result.mediaItem?.id, + MediaItemIsPhoto = i.result.mediaItem?.isPhoto, + MediaItemIsVideo = i.result.mediaItem?.isVideo, + MediaItemMimeType = i.result.mediaItem?.mimeType, + MediaItemSyncDate = i.result.mediaItem?.syncDate, + MediaItemMetadataCreationTime = i.result.mediaItem?.mediaMetadata?.creationTime, + Json = JsonSerializer.Serialize(i.result.mediaItem), + FileNameTimestamp = i.fileNameTimestamp, + })); + } +} \ No newline at end of file diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240822040850_Initial.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240822040850_Initial.Designer.cs similarity index 96% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240822040850_Initial.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240822040850_Initial.Designer.cs index 04e80603..a020c134 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240822040850_Initial.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240822040850_Initial.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240822040850_Initial")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240822040850_Initial.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240822040850_Initial.cs similarity index 97% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240822040850_Initial.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240822040850_Initial.cs index b26a4895..5f76fcb2 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240822040850_Initial.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240822040850_Initial.cs @@ -3,7 +3,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class Initial : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824033010_ChatFoldersAdded.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824033010_ChatFoldersAdded.Designer.cs similarity index 97% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824033010_ChatFoldersAdded.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824033010_ChatFoldersAdded.Designer.cs index 9809db21..4f8609c1 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824033010_ChatFoldersAdded.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824033010_ChatFoldersAdded.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240824033010_ChatFoldersAdded")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824033010_ChatFoldersAdded.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824033010_ChatFoldersAdded.cs similarity index 94% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824033010_ChatFoldersAdded.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824033010_ChatFoldersAdded.cs index f5c98b5c..eec9edb5 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824033010_ChatFoldersAdded.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824033010_ChatFoldersAdded.cs @@ -2,7 +2,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class ChatFoldersAdded : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824034121_ChatsAdded.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824034121_ChatsAdded.Designer.cs similarity index 98% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824034121_ChatsAdded.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824034121_ChatsAdded.Designer.cs index ca5d383f..fc5e23b4 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824034121_ChatsAdded.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824034121_ChatsAdded.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240824034121_ChatsAdded")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824034121_ChatsAdded.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824034121_ChatsAdded.cs similarity index 95% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824034121_ChatsAdded.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824034121_ChatsAdded.cs index 34b92dfd..5db939e8 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824034121_ChatsAdded.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824034121_ChatsAdded.cs @@ -2,7 +2,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class ChatsAdded : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824040532_MessagesAdded.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824040532_MessagesAdded.Designer.cs similarity index 99% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824040532_MessagesAdded.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824040532_MessagesAdded.Designer.cs index d9caff40..c13768fd 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824040532_MessagesAdded.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824040532_MessagesAdded.Designer.cs @@ -6,11 +6,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240824040532_MessagesAdded")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824040532_MessagesAdded.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824040532_MessagesAdded.cs similarity index 98% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824040532_MessagesAdded.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824040532_MessagesAdded.cs index f8c2018d..59e22037 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824040532_MessagesAdded.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824040532_MessagesAdded.cs @@ -4,7 +4,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class MessagesAdded : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824044027_JsonConversion3.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824044027_JsonConversion3.Designer.cs similarity index 99% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824044027_JsonConversion3.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824044027_JsonConversion3.Designer.cs index 3d899249..61be59c0 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824044027_JsonConversion3.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824044027_JsonConversion3.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240824044027_JsonConversion3")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824044027_JsonConversion3.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824044027_JsonConversion3.cs similarity index 93% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824044027_JsonConversion3.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824044027_JsonConversion3.cs index cc589769..80f35c8e 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824044027_JsonConversion3.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824044027_JsonConversion3.cs @@ -2,7 +2,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class JsonConversion3 : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824045457_MessagesIndexAdded.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824045457_MessagesIndexAdded.Designer.cs similarity index 99% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824045457_MessagesIndexAdded.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824045457_MessagesIndexAdded.Designer.cs index d7db7e3b..327066a4 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824045457_MessagesIndexAdded.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824045457_MessagesIndexAdded.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240824045457_MessagesIndexAdded")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824045457_MessagesIndexAdded.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824045457_MessagesIndexAdded.cs similarity index 93% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824045457_MessagesIndexAdded.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824045457_MessagesIndexAdded.cs index d7350bee..7f0c626f 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824045457_MessagesIndexAdded.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824045457_MessagesIndexAdded.cs @@ -2,7 +2,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class MessagesIndexAdded : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824052457_InventoryItems.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824052457_InventoryItems.Designer.cs similarity index 99% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824052457_InventoryItems.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824052457_InventoryItems.Designer.cs index c4bca91a..61bc8cf5 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824052457_InventoryItems.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824052457_InventoryItems.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240824052457_InventoryItems")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824052457_InventoryItems.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824052457_InventoryItems.cs similarity index 97% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824052457_InventoryItems.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824052457_InventoryItems.cs index 091a5242..b911cf11 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824052457_InventoryItems.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824052457_InventoryItems.cs @@ -3,7 +3,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class InventoryItems : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824052740_InventoryItemsNullableColumns.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824052740_InventoryItemsNullableColumns.Designer.cs similarity index 99% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824052740_InventoryItemsNullableColumns.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824052740_InventoryItemsNullableColumns.Designer.cs index 954ba14d..324b63dc 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824052740_InventoryItemsNullableColumns.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824052740_InventoryItemsNullableColumns.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240824052740_InventoryItemsNullableColumns")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824052740_InventoryItemsNullableColumns.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824052740_InventoryItemsNullableColumns.cs similarity index 96% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824052740_InventoryItemsNullableColumns.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824052740_InventoryItemsNullableColumns.cs index adb27dfd..1880c87b 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240824052740_InventoryItemsNullableColumns.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240824052740_InventoryItemsNullableColumns.cs @@ -2,7 +2,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class InventoryItemsNullableColumns : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240829195209_Sources.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240829195209_Sources.Designer.cs similarity index 99% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240829195209_Sources.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240829195209_Sources.Designer.cs index 27c14b8b..e2cf21c3 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240829195209_Sources.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240829195209_Sources.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240829195209_Sources")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240829195209_Sources.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240829195209_Sources.cs similarity index 96% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240829195209_Sources.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240829195209_Sources.cs index 3c128663..4c25d9ee 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240829195209_Sources.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240829195209_Sources.cs @@ -2,7 +2,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class Sources : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240829195946_SourceTopics.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240829195946_SourceTopics.Designer.cs similarity index 99% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240829195946_SourceTopics.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240829195946_SourceTopics.Designer.cs index 22753bc2..01e70857 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240829195946_SourceTopics.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240829195946_SourceTopics.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240829195946_SourceTopics")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240829195946_SourceTopics.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240829195946_SourceTopics.cs similarity index 97% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240829195946_SourceTopics.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240829195946_SourceTopics.cs index 8050ad1d..70507aa5 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240829195946_SourceTopics.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240829195946_SourceTopics.cs @@ -2,7 +2,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class SourceTopics : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240903041348_SourcesRemoved.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240903041348_SourcesRemoved.Designer.cs similarity index 99% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240903041348_SourcesRemoved.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240903041348_SourcesRemoved.Designer.cs index 75d466c9..d94a483c 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240903041348_SourcesRemoved.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240903041348_SourcesRemoved.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240903041348_SourcesRemoved")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240903041348_SourcesRemoved.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240903041348_SourcesRemoved.cs similarity index 97% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240903041348_SourcesRemoved.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240903041348_SourcesRemoved.cs index 900a7984..d3b54650 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240903041348_SourcesRemoved.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240903041348_SourcesRemoved.cs @@ -2,7 +2,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class SourcesRemoved : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906063326_TopicsAdded.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906063326_TopicsAdded.Designer.cs similarity index 99% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906063326_TopicsAdded.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906063326_TopicsAdded.Designer.cs index 717ab144..9733ac6c 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906063326_TopicsAdded.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906063326_TopicsAdded.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240906063326_TopicsAdded")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906063326_TopicsAdded.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906063326_TopicsAdded.cs similarity index 97% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906063326_TopicsAdded.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906063326_TopicsAdded.cs index bfa37a46..edfc73c7 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906063326_TopicsAdded.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906063326_TopicsAdded.cs @@ -2,7 +2,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class TopicsAdded : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906083607_TopicsIndex.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906083607_TopicsIndex.Designer.cs similarity index 99% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906083607_TopicsIndex.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906083607_TopicsIndex.Designer.cs index 9c6802a7..a1104f66 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906083607_TopicsIndex.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906083607_TopicsIndex.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240906083607_TopicsIndex")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906083607_TopicsIndex.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906083607_TopicsIndex.cs similarity index 93% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906083607_TopicsIndex.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906083607_TopicsIndex.cs index ad0599d8..a963550d 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906083607_TopicsIndex.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906083607_TopicsIndex.cs @@ -2,7 +2,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class TopicsIndex : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906091328_MessageSelectedType.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906091328_MessageSelectedType.Designer.cs similarity index 99% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906091328_MessageSelectedType.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906091328_MessageSelectedType.Designer.cs index d96c3826..ba8d53ee 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906091328_MessageSelectedType.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906091328_MessageSelectedType.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240906091328_MessageSelectedType")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906091328_MessageSelectedType.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906091328_MessageSelectedType.cs similarity index 92% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906091328_MessageSelectedType.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906091328_MessageSelectedType.cs index 4718d4a7..325d114a 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906091328_MessageSelectedType.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906091328_MessageSelectedType.cs @@ -2,7 +2,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class MessageSelectedType : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906093400_Albums.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906093400_Albums.Designer.cs similarity index 99% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906093400_Albums.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906093400_Albums.Designer.cs index 03a86bff..e6512710 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906093400_Albums.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906093400_Albums.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240906093400_Albums")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906093400_Albums.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906093400_Albums.cs similarity index 97% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906093400_Albums.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906093400_Albums.cs index 76a9c3a0..b6bb8d1a 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906093400_Albums.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906093400_Albums.cs @@ -3,7 +3,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class Albums : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906094155_AlbumConstraintsInclusion.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906094155_AlbumConstraintsInclusion.Designer.cs similarity index 99% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906094155_AlbumConstraintsInclusion.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906094155_AlbumConstraintsInclusion.Designer.cs index 8a637495..9cdc46ba 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906094155_AlbumConstraintsInclusion.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906094155_AlbumConstraintsInclusion.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240906094155_AlbumConstraintsInclusion")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906094155_AlbumConstraintsInclusion.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906094155_AlbumConstraintsInclusion.cs similarity index 91% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906094155_AlbumConstraintsInclusion.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906094155_AlbumConstraintsInclusion.cs index 9279ce70..c59a48a0 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906094155_AlbumConstraintsInclusion.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906094155_AlbumConstraintsInclusion.cs @@ -2,7 +2,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class AlbumConstraintsInclusion : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906094322_AlbumConstraintsSelectedTypeVarChar.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906094322_AlbumConstraintsSelectedTypeVarChar.Designer.cs similarity index 99% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906094322_AlbumConstraintsSelectedTypeVarChar.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906094322_AlbumConstraintsSelectedTypeVarChar.Designer.cs index e84f78fe..f498b398 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906094322_AlbumConstraintsSelectedTypeVarChar.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906094322_AlbumConstraintsSelectedTypeVarChar.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240906094322_AlbumConstraintsSelectedTypeVarChar")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906094322_AlbumConstraintsSelectedTypeVarChar.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906094322_AlbumConstraintsSelectedTypeVarChar.cs similarity index 93% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906094322_AlbumConstraintsSelectedTypeVarChar.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906094322_AlbumConstraintsSelectedTypeVarChar.cs index ee388424..79ac3459 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906094322_AlbumConstraintsSelectedTypeVarChar.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906094322_AlbumConstraintsSelectedTypeVarChar.cs @@ -2,7 +2,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class AlbumConstraintsSelectedTypeVarChar : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906104238_UploadedAlbums.Designer.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906104238_UploadedAlbums.Designer.cs similarity index 99% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906104238_UploadedAlbums.Designer.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906104238_UploadedAlbums.Designer.cs index eb5f32fe..fcd59d71 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906104238_UploadedAlbums.Designer.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906104238_UploadedAlbums.Designer.cs @@ -5,11 +5,11 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] [Migration("20240906104238_UploadedAlbums")] diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906104238_UploadedAlbums.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906104238_UploadedAlbums.cs similarity index 95% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906104238_UploadedAlbums.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906104238_UploadedAlbums.cs index e45adf6a..35cf0cf8 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/20240906104238_UploadedAlbums.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/20240906104238_UploadedAlbums.cs @@ -2,7 +2,7 @@ #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { /// public partial class UploadedAlbums : Migration diff --git a/OneShelf.Videos/OneShelf.Videos.App/Migrations/VideosDatabaseModelSnapshot.cs b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/VideosDatabaseModelSnapshot.cs similarity index 88% rename from OneShelf.Videos/OneShelf.Videos.App/Migrations/VideosDatabaseModelSnapshot.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Migrations/VideosDatabaseModelSnapshot.cs index 40bf8120..2748334b 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Migrations/VideosDatabaseModelSnapshot.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Migrations/VideosDatabaseModelSnapshot.cs @@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OneShelf.Videos.App.Database; +using OneShelf.Videos.Database; #nullable disable -namespace OneShelf.Videos.App.Migrations.VideosDatabaseMigrations +namespace OneShelf.Videos.Database.Migrations.VideosDatabaseMigrations { [DbContext(typeof(VideosDatabase))] partial class VideosDatabaseModelSnapshot : ModelSnapshot @@ -22,7 +22,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.Album", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.Album", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -39,7 +39,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("Albums"); }); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.AlbumConstraint", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.AlbumConstraint", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -77,7 +77,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("AlbumConstraints"); }); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.ChatFolder", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.ChatFolder", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -101,7 +101,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ChatFolders"); }); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.InventoryItem", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.InventoryItem", b => { b.Property("DatabaseInventoryItemId") .ValueGeneratedOnAdd() @@ -191,7 +191,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("InventoryItems"); }); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.Json.Chat", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.Json.Chat", b => { b.Property("Id") .HasColumnType("bigint"); @@ -215,7 +215,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("Chats"); }); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.Json.Message", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.Json.Message", b => { b.Property("DatabaseMessageId") .ValueGeneratedOnAdd() @@ -377,7 +377,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("Messages"); }); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.Topic", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.Topic", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -407,7 +407,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("Topics"); }); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.UploadedAlbum", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.UploadedAlbum", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -430,7 +430,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("UploadedAlbums"); }); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.UploadedItem", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.UploadedItem", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -489,15 +489,15 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("UploadedItems"); }); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.AlbumConstraint", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.AlbumConstraint", b => { - b.HasOne("OneShelf.Videos.App.Database.Models.Album", "Album") + b.HasOne("OneShelf.Videos.Database.Models.Album", "Album") .WithMany("Constraints") .HasForeignKey("AlbumId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("OneShelf.Videos.App.Database.Models.Topic", "Topic") + b.HasOne("OneShelf.Videos.Database.Models.Topic", "Topic") .WithMany("AlbumConstraints") .HasForeignKey("TopicId"); @@ -506,26 +506,26 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Topic"); }); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.Json.Chat", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.Json.Chat", b => { - b.HasOne("OneShelf.Videos.App.Database.Models.ChatFolder", "ChatFolder") + b.HasOne("OneShelf.Videos.Database.Models.ChatFolder", "ChatFolder") .WithOne("Chat") - .HasForeignKey("OneShelf.Videos.App.Database.Models.Json.Chat", "ChatFolderId") + .HasForeignKey("OneShelf.Videos.Database.Models.Json.Chat", "ChatFolderId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("ChatFolder"); }); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.Json.Message", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.Json.Message", b => { - b.HasOne("OneShelf.Videos.App.Database.Models.Json.Chat", "Chat") + b.HasOne("OneShelf.Videos.Database.Models.Json.Chat", "Chat") .WithMany("Messages") .HasForeignKey("ChatId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("OneShelf.Videos.App.Database.Models.Topic", "Topic") + b.HasOne("OneShelf.Videos.Database.Models.Topic", "Topic") .WithMany("Messages") .HasForeignKey("TopicId"); @@ -534,9 +534,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Topic"); }); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.Topic", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.Topic", b => { - b.HasOne("OneShelf.Videos.App.Database.Models.Json.Chat", "Chat") + b.HasOne("OneShelf.Videos.Database.Models.Json.Chat", "Chat") .WithMany() .HasForeignKey("ChatId") .OnDelete(DeleteBehavior.Cascade) @@ -545,35 +545,35 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Chat"); }); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.UploadedAlbum", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.UploadedAlbum", b => { - b.HasOne("OneShelf.Videos.App.Database.Models.Album", "Album") + b.HasOne("OneShelf.Videos.Database.Models.Album", "Album") .WithOne("UploadedAlbum") - .HasForeignKey("OneShelf.Videos.App.Database.Models.UploadedAlbum", "AlbumId") + .HasForeignKey("OneShelf.Videos.Database.Models.UploadedAlbum", "AlbumId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Album"); }); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.Album", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.Album", b => { b.Navigation("Constraints"); b.Navigation("UploadedAlbum"); }); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.ChatFolder", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.ChatFolder", b => { b.Navigation("Chat"); }); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.Json.Chat", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.Json.Chat", b => { b.Navigation("Messages"); }); - modelBuilder.Entity("OneShelf.Videos.App.Database.Models.Topic", b => + modelBuilder.Entity("OneShelf.Videos.Database.Models.Topic", b => { b.Navigation("AlbumConstraints"); diff --git a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/Album.cs b/OneShelf.Videos/OneShelf.Videos.Database/Models/Album.cs similarity index 81% rename from OneShelf.Videos/OneShelf.Videos.App/Database/Models/Album.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Models/Album.cs index 8e5bf53d..3e54c6e3 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/Album.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Models/Album.cs @@ -1,4 +1,4 @@ -namespace OneShelf.Videos.App.Database.Models; +namespace OneShelf.Videos.Database.Models; public class Album { diff --git a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/AlbumConstraint.cs b/OneShelf.Videos/OneShelf.Videos.Database/Models/AlbumConstraint.cs similarity index 82% rename from OneShelf.Videos/OneShelf.Videos.App/Database/Models/AlbumConstraint.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Models/AlbumConstraint.cs index 984ccb5c..86f4af8b 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/AlbumConstraint.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Models/AlbumConstraint.cs @@ -1,6 +1,6 @@ -using OneShelf.Videos.App.Database.Models.Enums; +using OneShelf.Videos.Database.Models.Enums; -namespace OneShelf.Videos.App.Database.Models; +namespace OneShelf.Videos.Database.Models; public class AlbumConstraint { diff --git a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/ChatFolder.cs b/OneShelf.Videos/OneShelf.Videos.Database/Models/ChatFolder.cs similarity index 78% rename from OneShelf.Videos/OneShelf.Videos.App/Database/Models/ChatFolder.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Models/ChatFolder.cs index 46c50867..e7f40e1b 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/ChatFolder.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Models/ChatFolder.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; -using OneShelf.Videos.App.Database.Models.Json; +using OneShelf.Videos.Database.Models.Json; -namespace OneShelf.Videos.App.Database.Models; +namespace OneShelf.Videos.Database.Models; [Index(nameof(Name), IsUnique = true)] public class ChatFolder diff --git a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/Enums/MessageSelectedType.cs b/OneShelf.Videos/OneShelf.Videos.Database/Models/Enums/MessageSelectedType.cs similarity index 50% rename from OneShelf.Videos/OneShelf.Videos.App/Database/Models/Enums/MessageSelectedType.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Models/Enums/MessageSelectedType.cs index 14af9b20..b584c99d 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/Enums/MessageSelectedType.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Models/Enums/MessageSelectedType.cs @@ -1,4 +1,4 @@ -namespace OneShelf.Videos.App.Database.Models.Enums; +namespace OneShelf.Videos.Database.Models.Enums; public enum MessageSelectedType { diff --git a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/InventoryItem.cs b/OneShelf.Videos/OneShelf.Videos.Database/Models/InventoryItem.cs similarity index 97% rename from OneShelf.Videos/OneShelf.Videos.App/Database/Models/InventoryItem.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Models/InventoryItem.cs index 117fa8a8..2af506cf 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/InventoryItem.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Models/InventoryItem.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace OneShelf.Videos.App.Database.Models; +namespace OneShelf.Videos.Database.Models; public class InventoryItem { diff --git a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/Json/Chat.cs b/OneShelf.Videos/OneShelf.Videos.Database/Models/Json/Chat.cs similarity index 91% rename from OneShelf.Videos/OneShelf.Videos.App/Database/Models/Json/Chat.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Models/Json/Chat.cs index 639350f2..45c14188 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/Json/Chat.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Models/Json/Chat.cs @@ -2,7 +2,7 @@ using System.Text.Json.Serialization; using Microsoft.EntityFrameworkCore; -namespace OneShelf.Videos.App.Database.Models.Json; +namespace OneShelf.Videos.Database.Models.Json; [Index(nameof(ChatFolderId), IsUnique = true)] public class Chat diff --git a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/Json/Message.cs b/OneShelf.Videos/OneShelf.Videos.Database/Models/Json/Message.cs similarity index 96% rename from OneShelf.Videos/OneShelf.Videos.App/Database/Models/Json/Message.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Models/Json/Message.cs index 572e7765..ce1eb2c2 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/Json/Message.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Models/Json/Message.cs @@ -2,9 +2,9 @@ using System.Text.Json; using System.Text.Json.Serialization; using Microsoft.EntityFrameworkCore; -using OneShelf.Videos.App.Database.Models.Enums; +using OneShelf.Videos.Database.Models.Enums; -namespace OneShelf.Videos.App.Database.Models.Json; +namespace OneShelf.Videos.Database.Models.Json; [Index(nameof(ChatId), nameof(Id), IsUnique = true)] public class Message diff --git a/OneShelf.Videos/OneShelf.Videos.App/ChatModels/TextEntity.cs b/OneShelf.Videos/OneShelf.Videos.Database/Models/Json/TextEntity.cs similarity index 59% rename from OneShelf.Videos/OneShelf.Videos.App/ChatModels/TextEntity.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Models/Json/TextEntity.cs index ce9448b5..5026688b 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/ChatModels/TextEntity.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Models/Json/TextEntity.cs @@ -1,6 +1,6 @@ -namespace OneShelf.Videos.App.ChatModels; +namespace OneShelf.Videos.Database.Models.Json; -// todo: actually used to be referenced by the Message (TextEntities was a collection of it). This type may be useful in the future. +[Obsolete("Actually used to be referenced by the Message (TextEntities was a collection of it). This type may be useful in the future.")] public class TextEntity { public required string Type { get; set; } diff --git a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/Topic.cs b/OneShelf.Videos/OneShelf.Videos.Database/Models/Topic.cs similarity index 84% rename from OneShelf.Videos/OneShelf.Videos.App/Database/Models/Topic.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Models/Topic.cs index d1b969f5..deaff7ca 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/Topic.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Models/Topic.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; -using OneShelf.Videos.App.Database.Models.Json; +using OneShelf.Videos.Database.Models.Json; -namespace OneShelf.Videos.App.Database.Models; +namespace OneShelf.Videos.Database.Models; [Index(nameof(ChatId), nameof(RootMessageIdOr0), IsUnique = true)] public class Topic diff --git a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/UploadedAlbum.cs b/OneShelf.Videos/OneShelf.Videos.Database/Models/UploadedAlbum.cs similarity index 80% rename from OneShelf.Videos/OneShelf.Videos.App/Database/Models/UploadedAlbum.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Models/UploadedAlbum.cs index 3638e04f..0dcd0d3d 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/UploadedAlbum.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Models/UploadedAlbum.cs @@ -1,4 +1,4 @@ -namespace OneShelf.Videos.App.Database.Models; +namespace OneShelf.Videos.Database.Models; public class UploadedAlbum { diff --git a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/UploadedItem.cs b/OneShelf.Videos/OneShelf.Videos.Database/Models/UploadedItem.cs similarity index 94% rename from OneShelf.Videos/OneShelf.Videos.App/Database/Models/UploadedItem.cs rename to OneShelf.Videos/OneShelf.Videos.Database/Models/UploadedItem.cs index 7dc17ad1..6772393e 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Database/Models/UploadedItem.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Models/UploadedItem.cs @@ -1,4 +1,4 @@ -namespace OneShelf.Videos.App.Database.Models; +namespace OneShelf.Videos.Database.Models; public class UploadedItem { diff --git a/OneShelf.Videos/OneShelf.Videos.Database/OneShelf.Videos.Database.csproj b/OneShelf.Videos/OneShelf.Videos.Database/OneShelf.Videos.Database.csproj new file mode 100644 index 00000000..313da3da --- /dev/null +++ b/OneShelf.Videos/OneShelf.Videos.Database/OneShelf.Videos.Database.csproj @@ -0,0 +1,15 @@ + + + + net8.0 + enable + enable + false + + + + + + + + diff --git a/OneShelf.Videos/OneShelf.Videos.Database/ServiceCollectionExtensions.cs b/OneShelf.Videos/OneShelf.Videos.Database/ServiceCollectionExtensions.cs new file mode 100644 index 00000000..ebdd7312 --- /dev/null +++ b/OneShelf.Videos/OneShelf.Videos.Database/ServiceCollectionExtensions.cs @@ -0,0 +1,12 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; + +namespace OneShelf.Videos.Database; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddVideosDatabase(this IServiceCollection serviceCollection, IConfiguration configuration) + => serviceCollection + .AddDbContext(o => o.UseSqlServer(configuration.GetConnectionString(nameof(VideosDatabase)))); +} \ No newline at end of file diff --git a/OneShelf.Videos/OneShelf.Videos.App/Database/VideosDatabase.cs b/OneShelf.Videos/OneShelf.Videos.Database/VideosDatabase.cs similarity index 81% rename from OneShelf.Videos/OneShelf.Videos.App/Database/VideosDatabase.cs rename to OneShelf.Videos/OneShelf.Videos.Database/VideosDatabase.cs index 38567927..994750c7 100644 --- a/OneShelf.Videos/OneShelf.Videos.App/Database/VideosDatabase.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/VideosDatabase.cs @@ -1,13 +1,11 @@ using System.Text.Encodings.Web; using System.Text.Json; using System.Text.Unicode; -using CasCap.Models; using Microsoft.EntityFrameworkCore; -using OneShelf.Videos.App.Database.Models; -using OneShelf.Videos.App.Database.Models.Json; -using Album = OneShelf.Videos.App.Database.Models.Album; +using OneShelf.Videos.Database.Models; +using OneShelf.Videos.Database.Models.Json; -namespace OneShelf.Videos.App.Database; +namespace OneShelf.Videos.Database; public class VideosDatabase : DbContext { @@ -110,28 +108,6 @@ from messages m "); } - public void AddItems(IEnumerable<(long chatId, int messageId, string path, DateTime publishedOn, NewMediaItemResult result, DateTime? fileNameTimestamp)> items) - { - UploadedItems.AddRange(items.Select(i => new UploadedItem - { - CreatedOn = DateTime.Now, - ChatId = i.chatId, - MessageId = i.messageId, - TelegramPublishedOn = i.publishedOn, - Status = i.result.status.status, - StatusCode = i.result.status.code, - StatusMessage = i.result.status.message, - MediaItemId = i.result.mediaItem?.id, - MediaItemIsPhoto = i.result.mediaItem?.isPhoto, - MediaItemIsVideo = i.result.mediaItem?.isVideo, - MediaItemMimeType = i.result.mediaItem?.mimeType, - MediaItemSyncDate = i.result.mediaItem?.syncDate, - MediaItemMetadataCreationTime = i.result.mediaItem?.mediaMetadata?.creationTime, - Json = JsonSerializer.Serialize(i.result.mediaItem), - FileNameTimestamp = i.fileNameTimestamp, - })); - } - protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder);