diff --git a/DownKyi/Services/BangumiInfoService.cs b/DownKyi/Services/BangumiInfoService.cs index cc1a5ff..69f1c6d 100644 --- a/DownKyi/Services/BangumiInfoService.cs +++ b/DownKyi/Services/BangumiInfoService.cs @@ -138,11 +138,9 @@ namespace DownKyi.Services /// 获取视频章节与剧集 /// /// - public List GetVideoSections() + public List GetVideoSections(bool noUgc = false) { if (bangumiSeason == null) { return null; } - if (bangumiSeason.Section == null) { return null; } - if (bangumiSeason.Section.Count == 0) { return null; } List videoSections = new List { @@ -155,6 +153,15 @@ namespace DownKyi.Services } }; + // 不需要其他季或花絮内容 + if (noUgc) + { + return videoSections; + } + + if (bangumiSeason.Section == null) { return null; } + if (bangumiSeason.Section.Count == 0) { return null; } + foreach (BangumiSection section in bangumiSeason.Section) { List pages = new List(); diff --git a/DownKyi/Services/CheeseInfoService.cs b/DownKyi/Services/CheeseInfoService.cs index 7f9fab7..62b5520 100644 --- a/DownKyi/Services/CheeseInfoService.cs +++ b/DownKyi/Services/CheeseInfoService.cs @@ -106,7 +106,7 @@ namespace DownKyi.Services /// 获取视频章节与剧集 /// /// - public List GetVideoSections() + public List GetVideoSections(bool noUgc = false) { return null; } diff --git a/DownKyi/Services/Download/AddToDownloadService.cs b/DownKyi/Services/Download/AddToDownloadService.cs index 0733d57..242bcea 100644 --- a/DownKyi/Services/Download/AddToDownloadService.cs +++ b/DownKyi/Services/Download/AddToDownloadService.cs @@ -103,7 +103,7 @@ namespace DownKyi.Services.Download return; } - videoSections = videoInfoService.GetVideoSections(); + videoSections = videoInfoService.GetVideoSections(true); if (videoSections == null) { LogManager.Debug(Tag, "videoSections is not exist."); diff --git a/DownKyi/Services/IInfoService.cs b/DownKyi/Services/IInfoService.cs index a882569..43bd09b 100644 --- a/DownKyi/Services/IInfoService.cs +++ b/DownKyi/Services/IInfoService.cs @@ -7,7 +7,7 @@ namespace DownKyi.Services { VideoInfoView GetVideoView(); - List GetVideoSections(); + List GetVideoSections(bool noUgc); List GetVideoPages(); diff --git a/DownKyi/Services/VideoInfoService.cs b/DownKyi/Services/VideoInfoService.cs index 9c34ca4..ed9738b 100644 --- a/DownKyi/Services/VideoInfoService.cs +++ b/DownKyi/Services/VideoInfoService.cs @@ -114,15 +114,30 @@ namespace DownKyi.Services /// 获取视频章节与剧集 /// /// - public List GetVideoSections() + public List GetVideoSections(bool noUgc = false) { if (videoView == null) { return null; } + + List videoSections = new List(); + + // 不需要ugc内容 + if (noUgc) + { + videoSections.Add(new VideoSection + { + Id = 0, + Title = "default", + IsSelected = true, + VideoPages = GetVideoPages() + }); + + return videoSections; + } + if (videoView.UgcSeason == null) { return null; } if (videoView.UgcSeason.Sections == null) { return null; } if (videoView.UgcSeason.Sections.Count == 0) { return null; } - List videoSections = new List(); - foreach (UgcSection section in videoView.UgcSeason.Sections) { List pages = new List(); diff --git a/DownKyi/ViewModels/ViewVideoDetailViewModel.cs b/DownKyi/ViewModels/ViewVideoDetailViewModel.cs index ed1697f..f544be0 100644 --- a/DownKyi/ViewModels/ViewVideoDetailViewModel.cs +++ b/DownKyi/ViewModels/ViewVideoDetailViewModel.cs @@ -635,7 +635,7 @@ namespace DownKyi.ViewModels NoDataVisibility = Visibility.Collapsed; } - List videoSections = videoInfoService.GetVideoSections(); + List videoSections = videoInfoService.GetVideoSections(false); if (videoSections == null) { LogManager.Debug(Tag, "videoSections is not exist.");