using dy.net.model.dto; using MediaStorageType = dy.net.model.dto.StorageType; using dy.net.utils; using SqlSugar; namespace dy.net.model.entity { [SugarTable(TableName = "dy_collect_video")] public class DouyinVideo { /// /// /// [SugarColumn(IsPrimaryKey = true)] public string Id { get; set; } [SugarColumn(Length = 200, IsNullable = true)] public string DyUserId { get; set; } [SugarColumn(IsIgnore = true)] public string DyUser { get; set; } [SugarColumn(Length = 200, IsNullable = true)] public string CookieId { get; set; } /// /// aweme_id /// [SugarColumn(Length = 200, IsNullable = true)] public string AwemeId { get; set; } public DateTime SyncTime { get; set; } public DateTime CreateTime { get; set; } /// /// 视频标题 /// [SugarColumn(Length = 2000, IsNullable = true)] public string VideoTitle { get; set; } /// /// 如果配置文件 UperFileNameUseViedoTitle=true /// 简化后的标题 默认空 只有关注的博主的 视频会存储该字段,实际UP主的视频文件名是 VideoTitleSimplify + VideoTitleSimplifyPrefix /// [SugarColumn(Length = 500, IsNullable = true)] public string VideoTitleSimplify { get; set; } /// /// 精简标题的前缀 默认空,其实就是序号,类似 001-,002- /// [SugarColumn(Length = 50, IsNullable = true)] public string VideoTitleSimplifyPrefix { get; set; } /// /// 标签(分类) /// [SugarColumn(Length = 200, IsNullable = true)] public string Tag1 { get; set; } /// /// 标签(分类) /// [SugarColumn(Length = 200, IsNullable = true)] public string Tag2 { get; set; } [SugarColumn(Length = 200, IsNullable = true)] public string Tag3 { get; set; } ///// ///// 视频描述 ///// //public string VideoDesc { get; set; } /// /// 视频地址(解析会有多个取第一个) /// [SugarColumn(Length = 2000, IsNullable = true)] public string VideoUrl { get; set; } /// /// 视频下载后保存路径 /// [SugarColumn(Length = 2000, IsNullable = true)] public string VideoSavePath { get; set; } /// /// 该记录实际所在存储。旧数据默认值 0 表示本地文件。 /// public MediaStorageType StorageType { get; set; } = MediaStorageType.Local; /// /// 视频封面地址 /// [SugarColumn(Length = 2000, IsNullable = true)] public string VideoCoverUrl { get; set; } /// /// 视频封面保存路径 /// [SugarColumn(Length = 2000, IsNullable = true)] public string VideoCoverSavePath { get; set; } /// /// 作者 /// [SugarColumn(Length = 200, IsNullable = true)] public string Author { get; set; } /// /// 作者ID /// [SugarColumn(Length = 200, IsNullable = true)] public string AuthorId { get; set; } /// /// 作者头像 /// [SugarColumn(Length = 2000, IsNullable = true)] public string AuthorAvatar { get; set; } [SugarColumn(Length = 2000, IsNullable = true)] public string AuthorAvatarUrl { get; set; } /// /// 文件hash值唯一值 /// [SugarColumn(Length = 200, IsNullable = true)] public string FileHash { get; set; } /// /// 文件大小(字节) /// [SugarColumn(Length = 200, IsNullable = true)] public long FileSize { get; set; } /// /// 分辨率(如1920x1080, 3840x2160等) /// [SugarColumn(Length = 200, IsNullable = true)] public string Resolution { get; set; } /// /// 作者发布视频日期 /// [SugarColumn(IsIgnore = true)] public string createTimeStr => CreateTime.ToString("yyyy-MM-dd HH:mm:ss"); [SugarColumn(IsIgnore = true)] public string SyncTimeStr => SyncTime.ToString("yyyy-MM-dd HH:mm:ss"); /// /// 1喜欢的,2收藏的,3关注的 ,4 图片视频 /// [SugarColumn(Length = 200, IsNullable = true)] public VideoTypeEnum ViedoType { get; set; } /// /// 是否合成视频 /// public int IsMergeVideo { get; set; } [SugarColumn(IsIgnore = true)] public string ViedoTypeStr => ViedoType.GetDesc(); [SugarColumn(IsIgnore = true)] public string ViedoCate => (string.IsNullOrWhiteSpace(Tag1) ? "" : Tag1) + "/" + (string.IsNullOrWhiteSpace(Tag2) ? "" : Tag2); // 普通字符串字段,显式标记为 SQLite TEXT 类型 [SugarColumn(ColumnDataType = "TEXT", Length = -1, IsNullable = true)] public string DynamicVideos { get; set; } /// /// 是否仅下载图片或仅下载音频 /// public bool OnlyImgOrOnlyMp3 { get; set; } /// /// 自定义收藏夹、合集、短剧 绑定的Id /// [SugarColumn(Length = 200, IsNullable = true)] public string CateId { get; set; } /// /// 自定义收藏夹、合集、短剧 绑定的XId /// [SugarColumn(Length = 200, IsNullable = true)] public string CateXId { get; set; } [SugarColumn(IsIgnore = true)] public string PendingStoragePath { get; set; } [SugarColumn(IsIgnore = true)] public string TemporaryDirectory { get; set; } [SugarColumn(IsIgnore = true)] public string TaskItemId { get; set; } [SugarColumn(IsIgnore = true)] public string TaskWarning { get; set; } /// /// 普通同步将旧存储记录安全替换到当前存储时使用的旧记录快照,不写入数据库。 /// [SugarColumn(IsIgnore = true)] public DouyinVideo SupersededStorageSnapshot { get; set; } } }