🐛 Fix bugs
This commit is contained in:
@@ -9,22 +9,6 @@ using NodaTime.Serialization.Protobuf;
|
||||
|
||||
namespace DysonNetwork.Drive.Storage;
|
||||
|
||||
/// <summary>
|
||||
/// The class that used in jsonb columns which referenced the cloud file.
|
||||
/// The aim of this class is to store some properties that won't change to a file to reduce the database load.
|
||||
/// </summary>
|
||||
public class CloudFileReferenceObject : ModelBase, ICloudFile
|
||||
{
|
||||
public string Id { get; set; } = null!;
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public Dictionary<string, object?> FileMeta { get; set; } = null!;
|
||||
public Dictionary<string, object>? UserMeta { get; set; } = null!;
|
||||
public string? MimeType { get; set; }
|
||||
public string? Hash { get; set; }
|
||||
public long Size { get; set; }
|
||||
public bool HasCompression { get; set; } = false;
|
||||
}
|
||||
|
||||
public class CloudFile : ModelBase, ICloudFile, IIdentifiedResource
|
||||
{
|
||||
/// The id generated by TuS, basically just UUID remove the dash lines
|
||||
@@ -87,6 +71,7 @@ public class CloudFile : ModelBase, ICloudFile, IIdentifiedResource
|
||||
Name = Name,
|
||||
FileMeta = FileMeta,
|
||||
UserMeta = UserMeta,
|
||||
SensitiveMarks = SensitiveMarks,
|
||||
MimeType = MimeType,
|
||||
Hash = Hash,
|
||||
Size = Size,
|
||||
@@ -105,7 +90,7 @@ public class CloudFile : ModelBase, ICloudFile, IIdentifiedResource
|
||||
var proto = new Shared.Proto.CloudFile
|
||||
{
|
||||
Id = Id,
|
||||
Name = Name ?? string.Empty,
|
||||
Name = Name,
|
||||
MimeType = MimeType ?? string.Empty,
|
||||
Hash = Hash ?? string.Empty,
|
||||
Size = Size,
|
||||
|
@@ -12,6 +12,7 @@ using NetVips;
|
||||
using NodaTime;
|
||||
using tusdotnet.Stores;
|
||||
using System.Linq.Expressions;
|
||||
using DysonNetwork.Shared.Data;
|
||||
using Microsoft.EntityFrameworkCore.Query;
|
||||
|
||||
namespace DysonNetwork.Drive.Storage;
|
||||
|
@@ -1,3 +1,4 @@
|
||||
using DysonNetwork.Shared.Data;
|
||||
using DysonNetwork.Shared.Proto;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using Grpc.Core;
|
||||
|
Reference in New Issue
Block a user