Simplify max bucket fingerprint retrieval
This commit is contained in:
parent
0d69c3a9d5
commit
259bddfc1a
@ -788,29 +788,13 @@ public class FingerprinterTask : IScheduledTask
|
|||||||
var goodFingerprints = new List<ReadOnlyCollection<uint>>();
|
var goodFingerprints = new List<ReadOnlyCollection<uint>>();
|
||||||
foreach (var id in maxBucket.Episodes)
|
foreach (var id in maxBucket.Episodes)
|
||||||
{
|
{
|
||||||
// Sometimes an episode isn't in the fingerprint cache. When this occurs, it has to be fingerprinted again.
|
if (!_fingerprintCache.TryGetValue(id, out var fp))
|
||||||
_logger.LogTrace("Second pass: searching cache for {Id}", id);
|
{
|
||||||
|
_logger.LogTrace("Second pass: max bucket episode {Id} not in cache, skipping", id);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (_fingerprintCache.ContainsKey(id))
|
goodFingerprints.Add(fp);
|
||||||
{
|
|
||||||
_logger.LogTrace("Second pass: cache hit for {Id}", id);
|
|
||||||
goodFingerprints.Add(_fingerprintCache[id]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_logger.LogTrace("Second pass: cache miss for {Id}", id);
|
|
||||||
|
|
||||||
var fullEp = episodes.Find((e) => { return e.EpisodeId == id; });
|
|
||||||
|
|
||||||
if (fullEp is not null)
|
|
||||||
{
|
|
||||||
goodFingerprints.Add(Chromaprint.Fingerprint(fullEp));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_logger.LogTrace("Second pass: unable to find episode {Id}", id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var episode in episodes)
|
foreach (var episode in episodes)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user