mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 06:18:00 +00:00
Added backups of all data, restorable on another computer (#1008)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
ab45580473
commit
936043319c
144 files changed
+10417
-424
No files matched your search
@@ -1,3 +1,5 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace AIStudio.Chat;
|
||||
|
||||
public record FileAttachmentImage(string FileName, string FilePath, long FileSizeBytes) : FileAttachment(FileAttachmentType.IMAGE, FileName, FilePath, FileSizeBytes), IImageSource
|
||||
@@ -13,5 +15,18 @@ public record FileAttachmentImage(string FileName, string FilePath, long FileSiz
|
||||
/// <summary>
|
||||
/// The image source.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// An attached image is a file, so its source is the path of that file. It is not stored a second
|
||||
/// time: the stored file path is relative when the image lies below the data directory, and the
|
||||
/// source has to follow it when the chat is read again, on whatever computer that happens.
|
||||
/// </remarks>
|
||||
[JsonIgnore]
|
||||
public string Source { get; set; } = FilePath;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override FileAttachment WithFilePath(string filePath) => new FileAttachmentImage(this.FileName, filePath, this.FileSizeBytes)
|
||||
{
|
||||
SourceType = this.SourceType,
|
||||
Source = this.SourceType is ContentImageSource.LOCAL_PATH ? filePath : this.Source,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user