From 430385f8e75c35cd16c6a61180f07fad1c176125 Mon Sep 17 00:00:00 2001 From: Pavel Zhur Date: Fri, 27 Sep 2024 18:31:47 +0300 Subject: [PATCH] removed the hardcoded path from the static chat folder --- .../OneShelf.Videos.BusinessLogic/Services/Service1.cs | 2 +- .../OneShelf.Videos.Database/Models/Static/StaticChatFolder.cs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/OneShelf.Videos/OneShelf.Videos.BusinessLogic/Services/Service1.cs b/OneShelf.Videos/OneShelf.Videos.BusinessLogic/Services/Service1.cs index 77a93b33..332c7122 100644 --- a/OneShelf.Videos/OneShelf.Videos.BusinessLogic/Services/Service1.cs +++ b/OneShelf.Videos/OneShelf.Videos.BusinessLogic/Services/Service1.cs @@ -83,7 +83,7 @@ public async Task SaveMessages() { foreach (var (chatFolder, i) in (await _videosDatabase.StaticChatFolders.Where(f => f.StaticChat == null).ToListAsync()).WithIndices()) { - var result = JsonSerializer.Deserialize(await File.ReadAllTextAsync(chatFolder.ResultJsonFullPath), new JsonSerializerOptions + var result = JsonSerializer.Deserialize(await File.ReadAllTextAsync(Path.Combine(chatFolder.Root, "result.json")), new JsonSerializerOptions { UnmappedMemberHandling = JsonUnmappedMemberHandling.Disallow, PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower, diff --git a/OneShelf.Videos/OneShelf.Videos.Database/Models/Static/StaticChatFolder.cs b/OneShelf.Videos/OneShelf.Videos.Database/Models/Static/StaticChatFolder.cs index a587d34f..91760fd7 100644 --- a/OneShelf.Videos/OneShelf.Videos.Database/Models/Static/StaticChatFolder.cs +++ b/OneShelf.Videos/OneShelf.Videos.Database/Models/Static/StaticChatFolder.cs @@ -11,7 +11,5 @@ public class StaticChatFolder public required string Root { get; set; } - public string ResultJsonFullPath => Path.Combine(Root, "result.json"); - public StaticChat? StaticChat { get; set; } } \ No newline at end of file