65 lines
1.8 KiB
C#
65 lines
1.8 KiB
C#
|
|
using System.Text.Json.Serialization;
|
||
|
|
|
||
|
|
namespace Avalonia_Services.Services.FileLibrary
|
||
|
|
{
|
||
|
|
public sealed record AddLibraryRootRequest(
|
||
|
|
[property: JsonPropertyName("path")] string? Path,
|
||
|
|
[property: JsonPropertyName("displayName")] string? DisplayName = null,
|
||
|
|
[property: JsonPropertyName("scanIntervalMinutes")] int? ScanIntervalMinutes = null);
|
||
|
|
|
||
|
|
public sealed record UpdateLibraryRootRequest(
|
||
|
|
[property: JsonPropertyName("id")] int Id,
|
||
|
|
[property: JsonPropertyName("isEnabled")] bool IsEnabled);
|
||
|
|
|
||
|
|
public sealed record ScanLibraryRootRequest(
|
||
|
|
[property: JsonPropertyName("id")] int Id);
|
||
|
|
|
||
|
|
public sealed record DeleteLibraryRootRequest(
|
||
|
|
[property: JsonPropertyName("id")] int Id);
|
||
|
|
|
||
|
|
public sealed record DriveDto(
|
||
|
|
string Name,
|
||
|
|
string DisplayName,
|
||
|
|
string RootDirectory,
|
||
|
|
string DriveType,
|
||
|
|
long? TotalSize,
|
||
|
|
long? AvailableFreeSpace,
|
||
|
|
bool IsReady);
|
||
|
|
|
||
|
|
public sealed record DirectoryDto(
|
||
|
|
string Name,
|
||
|
|
string FullPath);
|
||
|
|
|
||
|
|
public sealed record LibraryRootDto(
|
||
|
|
int Id,
|
||
|
|
string Path,
|
||
|
|
string DisplayName,
|
||
|
|
bool IsEnabled,
|
||
|
|
bool IsAvailable,
|
||
|
|
int ScanIntervalMinutes,
|
||
|
|
DateTime? LastScanStartedAt,
|
||
|
|
DateTime? LastScanCompletedAt,
|
||
|
|
string? LastScanError,
|
||
|
|
int FileCount);
|
||
|
|
|
||
|
|
public sealed record FileRecordDto(
|
||
|
|
int Id,
|
||
|
|
int LibraryRootId,
|
||
|
|
string FileName,
|
||
|
|
string RelativePath,
|
||
|
|
string Extension,
|
||
|
|
long SizeBytes,
|
||
|
|
DateTime LastWriteTimeUtc,
|
||
|
|
string MediaType,
|
||
|
|
string ContentType,
|
||
|
|
string StreamUrl,
|
||
|
|
string? TextUrl,
|
||
|
|
bool BrowserPlayable);
|
||
|
|
|
||
|
|
public sealed record TextPreviewDto(
|
||
|
|
int Id,
|
||
|
|
string FileName,
|
||
|
|
string Content,
|
||
|
|
bool Truncated);
|
||
|
|
}
|