feat: 视频缩略图生成、最近文件面板与前端视图重构
- 新增 VideoThumbnailService,基于 ffmpeg 截取视频缩略图,ffprobe 提取时长
- 新增 ManagedThumbnailMap 模型及多数据库迁移,存储缩略图元数据
- 新增 /api/thumbnails/{id} 缩略图流端点
- 新增最近添加/最近播放 API 与前端面板,支持列表/网格双视图切换
- FileRecordDto 扩展 thumbnailUrl、videoDuration、lastPlayedAt 字段
- 前端新增文件库 Tab 导航、卡片网格视图、视频海报与时长信息栏
- 添加文件库目录不再同步全量扫描,改为后台异步自动扫描
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// <auto-generated />
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using FileShare_EFCore.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -116,6 +116,10 @@ namespace FileShare_EFCore.Migrations.SQLite
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("file-name");
|
||||
|
||||
b.Property<DateTime?>("LastPlayedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last-played-at");
|
||||
|
||||
b.Property<DateTime>("LastSeenAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("last-seen-at");
|
||||
@@ -144,10 +148,18 @@ namespace FileShare_EFCore.Migrations.SQLite
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("size-bytes");
|
||||
|
||||
b.Property<int?>("ThumbnailId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("thumbnail-id");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("updated-at");
|
||||
|
||||
b.Property<double?>("VideoDuration")
|
||||
.HasColumnType("REAL")
|
||||
.HasColumnName("video-duration");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk-managed-file-record");
|
||||
|
||||
@@ -155,9 +167,15 @@ namespace FileShare_EFCore.Migrations.SQLite
|
||||
.IsUnique()
|
||||
.HasDatabaseName("idx-managed-file-record-absolute-path");
|
||||
|
||||
b.HasIndex("LastPlayedAt")
|
||||
.HasDatabaseName("idx-managed-file-record-last-played-at");
|
||||
|
||||
b.HasIndex("LibraryRootId")
|
||||
.HasDatabaseName("idx-managed-file-record-root-id");
|
||||
|
||||
b.HasIndex("ThumbnailId")
|
||||
.HasDatabaseName("idx-managed-file-record-thumbnail-id");
|
||||
|
||||
b.HasIndex("MediaType", "Exists")
|
||||
.HasDatabaseName("idx-managed-file-record-media-type-exists");
|
||||
|
||||
@@ -234,6 +252,53 @@ namespace FileShare_EFCore.Migrations.SQLite
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FileShare_EFCore.Models.ManagedThumbnailMap", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("ContentType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("content-type");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("created-at");
|
||||
|
||||
b.Property<int>("LibraryRootId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("library-root-id");
|
||||
|
||||
b.Property<string>("RelativePath")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1024)
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("relative-path");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("updated-at");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk-managed-thumbnail-map");
|
||||
|
||||
b.HasIndex("LibraryRootId")
|
||||
.HasDatabaseName("idx-managed-thumbnail-map-root-id");
|
||||
|
||||
b.HasIndex("RelativePath")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("idx-managed-thumbnail-map-relative-path");
|
||||
|
||||
b.ToTable("managed-thumbnail-map", t =>
|
||||
{
|
||||
t.HasComment("文件缩略图映射记录");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FileShare_EFCore.Models.UserEntity", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -336,10 +401,35 @@ namespace FileShare_EFCore.Migrations.SQLite
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("FileShare_EFCore.Models.ManagedThumbnailMap", "Thumbnail")
|
||||
.WithMany("Files")
|
||||
.HasForeignKey("ThumbnailId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.Navigation("LibraryRoot");
|
||||
|
||||
b.Navigation("Thumbnail");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FileShare_EFCore.Models.ManagedThumbnailMap", b =>
|
||||
{
|
||||
b.HasOne("FileShare_EFCore.Models.ManagedLibraryRoot", "LibraryRoot")
|
||||
.WithMany("Thumbnails")
|
||||
.HasForeignKey("LibraryRootId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LibraryRoot");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FileShare_EFCore.Models.ManagedLibraryRoot", b =>
|
||||
{
|
||||
b.Navigation("Files");
|
||||
|
||||
b.Navigation("Thumbnails");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FileShare_EFCore.Models.ManagedThumbnailMap", b =>
|
||||
{
|
||||
b.Navigation("Files");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user