Don't "shift" episodes that didn't load

This commit is contained in:
TwistedUmbrellaX 2024-03-05 17:58:32 -05:00
parent 86bda25946
commit 79c834cf08
2 changed files with 26 additions and 3 deletions

View File

@ -850,12 +850,16 @@
switch (e.key) {
case "ArrowDown":
if (timestampError.value != "") {
// if the control key is pressed, shift LHS by 10s. Otherwise, shift by 1.
offsetDelta = e.ctrlKey ? 10 / 0.128 : 1;
}
break;
case "ArrowUp":
if (timestampError.value != "") {
offsetDelta = e.ctrlKey ? -10 / 0.128 : -1;
}
break;
case "ArrowRight":

View File

@ -605,6 +605,25 @@ public static class FFmpegWrapper
Encoding.UTF8).ConfigureAwait(false);
}
/// <summary>
/// Remove a cached episode fingerprint from disk.
/// </summary>
/// <param name="episodeId">Episode to remove from cache.</param>
/// <param name="mode">Analysis mode.</param>
public static void DeleteEpisodeCache(string episodeId, AnalysisMode mode)
{
var cachePath = Path.Join(
Plugin.Instance!.FingerprintCachePath,
episodeId);
if (mode == AnalysisMode.Credits)
{
cachePath += "-credits";
}
File.Delete(cachePath);
}
/// <summary>
/// Determines the path an episode should be cached at.
/// This function was created before the unified caching mechanism was introduced (in v0.1.7).