修复m3u8同步问题

This commit is contained in:
nilaoda 2022-09-28 19:59:48 +08:00
parent 578ca84115
commit fa76a101fa
1 changed files with 2 additions and 2 deletions

View File

@ -593,12 +593,12 @@ namespace N_m3u8DL_RE.DownloadManager
ConcurrentDictionary<int, SpeedContainer> SpeedContainerDic = new(); //速度计算
ConcurrentDictionary<StreamSpec, bool?> Results = new();
//取最后15个分片
var minIndex = SelectedSteams.Max(s => s.Playlist!.MediaParts[0].MediaSegments.Min(s => s.Index));
var maxIndex = SelectedSteams.Min(s => s.Playlist!.MediaParts[0].MediaSegments.Max(s => s.Index));
foreach (var item in SelectedSteams)
{
foreach (var part in item.Playlist!.MediaParts)
{
part.MediaSegments = part.MediaSegments.Where(s => s.Index >= minIndex).TakeLast(takeLastCount).ToList();
part.MediaSegments = part.MediaSegments.Where(s => s.Index <= maxIndex).TakeLast(takeLastCount).ToList();
}
}
//初始化dic