From d81ea8bfea3b9c595ed84e55bf80ce418da8270a Mon Sep 17 00:00:00 2001 From: routersys Date: Sun, 13 Sep 2026 10:55:15 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7=E3=83=A5?= =?UTF-8?q?=E3=81=AE=E7=B4=A2=E5=BC=95=E3=81=AE=E5=9E=8B=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProxyForge/Cache/ProxyCacheEntry.cs | 71 +++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 ProxyForge/Cache/ProxyCacheEntry.cs diff --git a/ProxyForge/Cache/ProxyCacheEntry.cs b/ProxyForge/Cache/ProxyCacheEntry.cs new file mode 100644 index 0000000..a7a544c --- /dev/null +++ b/ProxyForge/Cache/ProxyCacheEntry.cs @@ -0,0 +1,71 @@ +namespace ProxyForge.Cache; + +internal sealed class ProxyCacheEntry +{ + public Guid Id { get; set; } + + public string SourcePath { get; set; } = string.Empty; + + public long SourceLength { get; set; } + + public long SourceWriteTimeTicks { get; set; } + + public int Scale { get; set; } + + public int ProxyWidth { get; set; } + + public int ProxyHeight { get; set; } + + public float DisplayLeft { get; set; } + + public float DisplayTop { get; set; } + + public float DisplayWidth { get; set; } + + public float DisplayHeight { get; set; } + + public int FrameRateNumerator { get; set; } + + public int FrameRateDenominator { get; set; } + + public long DurationTicks { get; set; } + + public int FrameCount { get; set; } + + public long FileLength { get; set; } + + public long CreatedTicks { get; set; } + + public long LastUsedTicks { get; set; } + + public bool Matches(SourceIdentity source, int scale) + => Scale == scale && source.Matches(SourcePath, SourceLength, SourceWriteTimeTicks); + + public ProxyCacheEntry Clone() => (ProxyCacheEntry)MemberwiseClone(); +} + +internal enum ProxyCacheSkipReason +{ + Transparent, +} + +internal sealed class ProxyCacheSkip +{ + public string SourcePath { get; set; } = string.Empty; + + public long SourceLength { get; set; } + + public long SourceWriteTimeTicks { get; set; } + + public ProxyCacheSkipReason Reason { get; set; } + + public bool Matches(SourceIdentity source) + => source.Matches(SourcePath, SourceLength, SourceWriteTimeTicks); +} + +internal sealed class ProxyCacheIndex +{ + public List Entries { get; set; } = []; + + public List Skips { get; set; } = []; +}