Fix bug in `PlayMovie.PreHighlightMovie` heuristics

for the record, the bug was that it had `_movieList[indices[0]]` in the loop
instead of `_movieList[indices[i]]`
This commit is contained in:
YoshiRulz 2022-07-22 05:06:05 +10:00
parent 3f2a07e582
commit 9211007a18
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 3 additions and 19 deletions

View File

@ -212,27 +212,11 @@ namespace BizHawk.Client.EmuHawk
HighlightMovie(tas[0]);
return;
}
if (tas.Count > 1)
{
indices = new List<int>(tas);
}
// Final tie breaker - Last used file
var file = new FileInfo(_movieList[indices[0]].Filename);
var time = file.LastAccessTime;
var mostRecent = indices[0];
for (var i = 1; i < indices.Count; i++)
{
file = new FileInfo(_movieList[indices[0]].Filename);
if (file.LastAccessTime > time)
{
time = file.LastAccessTime;
mostRecent = indices[i];
}
}
HighlightMovie(mostRecent);
HighlightMovie(tas.Select(movieIndex => (Index: movieIndex, Timestamp: new FileInfo(_movieList[movieIndex].Filename).LastAccessTime))
.OrderByDescending(static tuple => tuple.Timestamp)
.First().Index);
}
private void HighlightMovie(int index)