75 lines
2.6 KiB
C#
75 lines
2.6 KiB
C#
namespace WebImageViewer.Class.Unified.Models;
|
|
|
|
/// <summary>
|
|
/// メディア種別(画像ギャラリー または 動画)
|
|
/// </summary>
|
|
public enum MediaType
|
|
{
|
|
Unknown,
|
|
Gallery,
|
|
Video
|
|
}
|
|
|
|
/// <summary>
|
|
/// ギャラリー内の各画像情報
|
|
/// </summary>
|
|
public class UnifiedImageInfo
|
|
{
|
|
public int PageNumber { get; set; }
|
|
public string ImageUrl { get; set; } = string.Empty;
|
|
public string? ThumbnailUrl { get; set; }
|
|
public string? AltText { get; set; }
|
|
public int? Width { get; set; }
|
|
public int? Height { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 統一画像ギャラリー情報モデル
|
|
/// </summary>
|
|
public class UnifiedGalleryItem
|
|
{
|
|
public string Id { get; set; } = string.Empty;
|
|
public string Title { get; set; } = string.Empty;
|
|
public string? JapaneseTitle { get; set; }
|
|
public string Category { get; set; } = "general";
|
|
public string SourceSite { get; set; } = string.Empty;
|
|
public string SourceUrl { get; set; } = string.Empty;
|
|
public string? ThumbnailUrl { get; set; }
|
|
public string? Author { get; set; }
|
|
public string? Circle { get; set; }
|
|
public List<string> Tags { get; set; } = new();
|
|
public List<UnifiedImageInfo> Images { get; set; } = new();
|
|
public int TotalPages => Images.Count;
|
|
public DateTime FetchedAt { get; set; } = DateTime.UtcNow;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 統一動画情報モデル
|
|
/// </summary>
|
|
public class UnifiedVideoItem
|
|
{
|
|
public string Site { get; set; } = "video";
|
|
public string VideoId { get; set; } = "video";
|
|
public string Title { get; set; } = "動画";
|
|
public string OriginalUrl { get; set; } = string.Empty;
|
|
public string? EmbedUrl { get; set; } // iframe埋め込みプレイヤーURL
|
|
public string? StreamUrl { get; set; } // 直接ストリームURL (HLS m3u8 または MP4)
|
|
public string? PosterUrl { get; set; } // サムネイル・ポスター画像URL
|
|
public string? EmbedHtml { get; set; } // 生のiframeタグやHTML埋め込みコード
|
|
public bool HasPlayableContent => !string.IsNullOrEmpty(EmbedUrl) || !string.IsNullOrEmpty(StreamUrl) || !string.IsNullOrEmpty(EmbedHtml);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 統一ビューアー解決結果モデル
|
|
/// </summary>
|
|
public class UnifiedViewerResult
|
|
{
|
|
public MediaType Type { get; set; } = MediaType.Unknown;
|
|
public string OriginalUrl { get; set; } = string.Empty;
|
|
public UnifiedGalleryItem? Gallery { get; set; }
|
|
public UnifiedVideoItem? Video { get; set; }
|
|
public bool IsSuccess { get; set; }
|
|
public string? ErrorMessage { get; set; }
|
|
public int StatusCode { get; set; } = 200;
|
|
}
|