Added work remaining url for remote extraction client

This commit is contained in:
2026-06-12 19:03:31 +02:00
parent 4c637de442
commit f1cffa7dfa
8 changed files with 220 additions and 4 deletions
@@ -62,10 +62,7 @@ public sealed class TruthDataService : ITruthDataService
return null;
}
var suffix = Plugin.Instance?.Configuration.TruthFileSuffix ?? ".jray.json";
var truthPath = Path.Combine(
Path.GetDirectoryName(item.Path) ?? string.Empty,
Path.GetFileNameWithoutExtension(item.Path) + suffix);
var truthPath = GetSidecarPath(item.Path);
if (!File.Exists(truthPath))
{
@@ -95,5 +92,19 @@ public sealed class TruthDataService : ITruthDataService
_cache.TryRemove(itemId, out _);
}
/// <inheritdoc />
public bool HasTruth(Guid itemId, string itemPath)
{
return _managedTruthStore.Exists(itemId) || File.Exists(GetSidecarPath(itemPath));
}
private static string GetSidecarPath(string itemPath)
{
var suffix = Plugin.Instance?.Configuration.TruthFileSuffix ?? ".jray.json";
return Path.Combine(
Path.GetDirectoryName(itemPath) ?? string.Empty,
Path.GetFileNameWithoutExtension(itemPath) + suffix);
}
private sealed record CacheEntry(TruthFile? Truth, DateTime LoadedAt);
}