1
0
Fork 0
Everything2Everything/src/Everything2Everything.Core/HistoryStore.cs
Yun Chan 198a39fd84 fix: Past Results 폴더 버튼이 출력 파일을 select하도록 변경
- HistoryEntry에 OutputPaths (nullable list) 추가, PrimaryOutputPath 헬퍼
- HistoryRow에 OutputPath + RevealPath (output 우선, fallback to source)
- AddToHistory 호출 시 result.OutputPaths.ToList() 전달
- XAML 폴더 버튼 Tag를 RevealPath로, ToolTip '출력 파일이 있는 폴더 열기'

이전 history.jsonl은 OutputPaths 없이 저장됨 — 새 변환부터 출력 select
2026-05-07 16:44:59 +09:00

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;
}