- HistoryEntry에 OutputPaths (nullable list) 추가, PrimaryOutputPath 헬퍼 - HistoryRow에 OutputPath + RevealPath (output 우선, fallback to source) - AddToHistory 호출 시 result.OutputPaths.ToList() 전달 - XAML 폴더 버튼 Tag를 RevealPath로, ToolTip '출력 파일이 있는 폴더 열기' 이전 history.jsonl은 OutputPaths 없이 저장됨 — 새 변환부터 출력 select
40 lines
1 KiB
C#
40 lines
1 KiB
C#
using System.Collections.ObjectModel;
|
|
|
|
namespace Everything2Everything.Core;
|
|
|
|
public sealed record HistoryEntry(
|
|
DateTime Timestamp,
|
|
string SourcePath,
|
|
string SourceFormat,
|
|
long SourceSizeBytes,
|
|
long OutputSizeBytes,
|
|
int OutputCount,
|
|
string? MetaLine,
|
|
ConvertStatus Status,
|
|
string? Message,
|
|
IReadOnlyList<string>? OutputPaths = null)
|
|
{
|
|
public long SavingsBytes => SourceSizeBytes - OutputSizeBytes;
|
|
|
|
public DateOnly Date => DateOnly.FromDateTime(Timestamp);
|
|
|
|
public string? PrimaryOutputPath => OutputPaths is { Count: > 0 } list ? list[0] : null;
|
|
}
|
|
|
|
public sealed class HistoryStore
|
|
{
|
|
private readonly ObservableCollection<HistoryEntry> _entries = new();
|
|
|
|
public ReadOnlyObservableCollection<HistoryEntry> Entries { get; }
|
|
|
|
public HistoryStore()
|
|
{
|
|
Entries = new ReadOnlyObservableCollection<HistoryEntry>(_entries);
|
|
}
|
|
|
|
public void Add(HistoryEntry entry) => _entries.Insert(0, entry);
|
|
|
|
public void Clear() => _entries.Clear();
|
|
|
|
public int Count => _entries.Count;
|
|
}
|