Skip to content

Commit

Permalink
removed the hardcoded path from the static chat folder
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-zhur committed Sep 27, 2024
1 parent 7d0d778 commit 430385f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<StaticChat>(await File.ReadAllTextAsync(chatFolder.ResultJsonFullPath), new JsonSerializerOptions
var result = JsonSerializer.Deserialize<StaticChat>(await File.ReadAllTextAsync(Path.Combine(chatFolder.Root, "result.json")), new JsonSerializerOptions
{
UnmappedMemberHandling = JsonUnmappedMemberHandling.Disallow,
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}

0 comments on commit 430385f

Please sign in to comment.