Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

修复后台会连播关联视频的问题 #944

Merged
merged 2 commits into from
Mar 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public async Task BackToHomeAsync()
_historyVideoList.Clear();
DanmakuViewModel.Instance.Reset();
IsPlayInformationError = false;
IsShowNextVideoTip = false;
await ClearInitViewModelAsync();
}

Expand All @@ -146,9 +147,8 @@ public async Task BackToHomeAsync()
/// </summary>
/// <param name="vm">视图模型.</param>
/// <param name="isRefresh">是否刷新.</param>
/// <param name="clearAdditionalList">是否清除附加列表 (比如稍后再看) 的数据.</param>
/// <returns><see cref="Task"/>.</returns>
public async Task LoadAsync(object vm, bool isRefresh = false, bool clearAdditionalList = true)
public async Task LoadAsync(object vm, bool isRefresh = false)
{
var videoId = string.Empty;
var seasonId = 0;
Expand All @@ -159,12 +159,6 @@ public async Task LoadAsync(object vm, bool isRefresh = false, bool clearAdditio

CurrentPlayingRecord record = null;

if (clearAdditionalList)
{
IsShowViewLater = false;
ViewLaterVideoCollection.Clear();
}

if (vm is VideoViewModel videoVM)
{
HandleVideoViewModel(videoVM);
Expand Down Expand Up @@ -225,6 +219,11 @@ void HandleVideoViewModel(VideoViewModel internalVM)
item.IsSelected = item.VideoId == internalVM.VideoId;
}
}
else
{
IsShowViewLater = false;
ViewLaterVideoCollection.Clear();
}
}
}

Expand Down Expand Up @@ -754,7 +753,7 @@ public async Task PlayNextVideoAsync()
if (index != -1 && index < ViewLaterVideoCollection.Count)
{
var nextVideo = ViewLaterVideoCollection[index + 1];
await LoadAsync(nextVideo, clearAdditionalList: false);
await LoadAsync(nextVideo);
}
}
else if (RelatedVideoCollection.Count > 0)
Expand Down