fix(web): 恢复视频继续播放和进度保存

- 将播放器收敛为单个共享实例,避免列表/网格内多个 video ref 导致进度保存失效
- 恢复视频播放器上方的继续播放提示
- 在播放、暂停、拖动、结束、切换页面和离开页面时保存播放位置
- 保留文件浏览分页和排序参数的前端调用
This commit is contained in:
2026-05-23 11:03:51 +08:00
parent 27e4029f4a
commit c6b05c12e5
22 changed files with 2449 additions and 165 deletions
@@ -64,7 +64,7 @@ namespace FileShare_Services.Services.FileLibrary
/// </summary>
public sealed record SaveFileProgressRequest(
[property: JsonPropertyName("id")] int Id,
[property: JsonPropertyName("position")] double Position);
[property: JsonPropertyName("position")] double? Position);
/// <summary>
/// 分页搜索已扫描文件的请求。
@@ -74,7 +74,9 @@ namespace FileShare_Services.Services.FileLibrary
[property: JsonPropertyName("pageSize")] int PageSize = 24,
[property: JsonPropertyName("mediaType")] string? MediaType = null,
[property: JsonPropertyName("keyword")] string? Keyword = null,
[property: JsonPropertyName("rootId")] int RootId = 0);
[property: JsonPropertyName("rootId")] int RootId = 0,
[property: JsonPropertyName("sortBy")] string? SortBy = null,
[property: JsonPropertyName("sortDirection")] string? SortDirection = null);
/// <summary>
/// 磁盘驱动器信息。
@@ -121,6 +123,7 @@ namespace FileShare_Services.Services.FileLibrary
string Extension,
long SizeBytes,
DateTime LastWriteTimeUtc,
DateTime? FileCreationTimeUtc,
string MediaType,
string ContentType,
string StreamUrl,
@@ -136,7 +139,12 @@ namespace FileShare_Services.Services.FileLibrary
/// </summary>
public sealed record BrowseDirectoryRequest(
[property: JsonPropertyName("rootId")] int RootId = 0,
[property: JsonPropertyName("path")] string? Path = null);
[property: JsonPropertyName("path")] string? Path = null,
[property: JsonPropertyName("page")] int Page = 1,
[property: JsonPropertyName("pageSize")] int PageSize = 48,
[property: JsonPropertyName("mediaType")] string? MediaType = null,
[property: JsonPropertyName("sortBy")] string? SortBy = "name",
[property: JsonPropertyName("sortDirection")] string? SortDirection = "asc");
/// <summary>
/// 浏览文件库目录的响应,包含当前路径、子目录列表和文件列表。
@@ -144,7 +152,11 @@ namespace FileShare_Services.Services.FileLibrary
public sealed record BrowseDirectoryResponse(
string CurrentPath,
List<string> Subdirectories,
List<FileRecordDto> Files);
List<FileRecordDto> Files,
int Total,
int Page,
int PageSize,
int TotalPages);
/// <summary>
/// 文本文件预览内容,支持截断标记。