From 260d3b76f3af673ae4b18f02c4e71f5ea79b3095 Mon Sep 17 00:00:00 2001
From: leiurayer <1432593898@qq.com>
Date: Sat, 5 Mar 2022 01:13:24 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=A8=8D=E5=90=8E=E5=86=8D?=
=?UTF-8?q?=E7=9C=8B=E9=A1=B5=E9=9D=A2=E5=92=8C=E5=8E=86=E5=8F=B2=E8=AE=B0?=
=?UTF-8?q?=E5=BD=95=E9=A1=B5=E9=9D=A2=EF=BC=9B=E4=BF=AE=E5=A4=8D=E4=B8=80?=
=?UTF-8?q?=E4=BA=9B=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/DownKyi.Core/BiliApi/History/History.cs | 63 +++
.../BiliApi/History/Models/HistoryBusiness.cs | 11 +
.../BiliApi/History/Models/HistoryCursor.cs | 17 +
.../BiliApi/History/Models/HistoryData.cs | 28 +
.../BiliApi/History/Models/HistoryList.cs | 46 ++
.../History/Models/HistoryListHistory.cs | 25 +
.../BiliApi/History/Models/ToViewData.cs | 27 +
.../BiliApi/History/Models/ToViewList.cs | 43 ++
src/DownKyi.Core/BiliApi/History/ToView.cs | 38 ++
src/DownKyi.Core/DownKyi.Core.csproj | 9 +
src/DownKyi.Core/Storage/StorageHeader.cs | 1 +
src/DownKyi/App.xaml.cs | 2 +
src/DownKyi/DownKyi.csproj | 18 +
src/DownKyi/Images/NormalIcon.cs | 73 +++
src/DownKyi/Languages/Default.xaml | 9 +
src/DownKyi/Services/FavoritesService.cs | 2 +-
.../PageViewModels/FavoritesMedia.cs | 4 +-
.../ViewModels/PageViewModels/HistoryMedia.cs | 175 ++++++
.../ViewModels/PageViewModels/ToViewMedia.cs | 107 ++++
.../ViewModels/ViewChannelViewModel.cs | 3 +-
.../ViewMyBangumiFollowViewModel.cs | 3 +
.../ViewModels/ViewMyFavoritesViewModel.cs | 1 +
.../ViewModels/ViewMyHistoryViewModel.cs | 499 ++++++++++++++++++
.../ViewModels/ViewMySpaceViewModel.cs | 4 +-
.../ViewModels/ViewMyToViewVideoViewModel.cs | 400 ++++++++++++++
.../ViewModels/ViewPublicationViewModel.cs | 1 +
src/DownKyi/Views/ViewMyBangumiFollow.xaml | 2 +-
src/DownKyi/Views/ViewMyFavorites.xaml | 2 +-
src/DownKyi/Views/ViewMyHistory.xaml | 362 +++++++++++++
src/DownKyi/Views/ViewMyHistory.xaml.cs | 28 +
src/DownKyi/Views/ViewMyToViewVideo.xaml | 286 ++++++++++
src/DownKyi/Views/ViewMyToViewVideo.xaml.cs | 28 +
src/DownKyi/Views/ViewPublication.xaml | 2 +-
33 files changed, 2310 insertions(+), 9 deletions(-)
create mode 100644 src/DownKyi.Core/BiliApi/History/History.cs
create mode 100644 src/DownKyi.Core/BiliApi/History/Models/HistoryBusiness.cs
create mode 100644 src/DownKyi.Core/BiliApi/History/Models/HistoryCursor.cs
create mode 100644 src/DownKyi.Core/BiliApi/History/Models/HistoryData.cs
create mode 100644 src/DownKyi.Core/BiliApi/History/Models/HistoryList.cs
create mode 100644 src/DownKyi.Core/BiliApi/History/Models/HistoryListHistory.cs
create mode 100644 src/DownKyi.Core/BiliApi/History/Models/ToViewData.cs
create mode 100644 src/DownKyi.Core/BiliApi/History/Models/ToViewList.cs
create mode 100644 src/DownKyi.Core/BiliApi/History/ToView.cs
create mode 100644 src/DownKyi/ViewModels/PageViewModels/HistoryMedia.cs
create mode 100644 src/DownKyi/ViewModels/PageViewModels/ToViewMedia.cs
create mode 100644 src/DownKyi/ViewModels/ViewMyHistoryViewModel.cs
create mode 100644 src/DownKyi/ViewModels/ViewMyToViewVideoViewModel.cs
create mode 100644 src/DownKyi/Views/ViewMyHistory.xaml
create mode 100644 src/DownKyi/Views/ViewMyHistory.xaml.cs
create mode 100644 src/DownKyi/Views/ViewMyToViewVideo.xaml
create mode 100644 src/DownKyi/Views/ViewMyToViewVideo.xaml.cs
diff --git a/src/DownKyi.Core/BiliApi/History/History.cs b/src/DownKyi.Core/BiliApi/History/History.cs
new file mode 100644
index 0000000..1bfd2bd
--- /dev/null
+++ b/src/DownKyi.Core/BiliApi/History/History.cs
@@ -0,0 +1,63 @@
+using DownKyi.Core.BiliApi.History.Models;
+using DownKyi.Core.Logging;
+using Newtonsoft.Json;
+using System;
+
+namespace DownKyi.Core.BiliApi.History
+{
+ ///
+ /// 历史记录
+ ///
+ public static class History
+ {
+ ///
+ /// 获取历史记录列表(视频、直播、专栏)
+ /// startId和startTime必须同时使用才有效,分别对应结果中的max和view_at,默认为0
+ ///
+ /// 历史记录开始目标ID
+ /// 历史记录开始时间
+ /// 每页项数
+ /// 历史记录ID类型
+ ///
+ public static HistoryData GetHistory(long startId, long startTime, int ps = 30, HistoryBusiness business = HistoryBusiness.ARCHIVE)
+ {
+ string businessStr = string.Empty;
+ switch (business)
+ {
+ case HistoryBusiness.ARCHIVE:
+ businessStr = "archive";
+ break;
+ case HistoryBusiness.PGC:
+ businessStr = "pgc";
+ break;
+ case HistoryBusiness.LIVE:
+ businessStr = "live";
+ break;
+ case HistoryBusiness.ARTICLE_LIST:
+ businessStr = "article-list";
+ break;
+ case HistoryBusiness.ARTICLE:
+ businessStr = "article";
+ break;
+ }
+
+ string url = $"https://api.bilibili.com/x/web-interface/history/cursor?max={startId}&view_at={startTime}&ps={ps}&business={businessStr}";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var history = JsonConvert.DeserializeObject(response);
+ if (history == null || history.Data == null) { return null; }
+ return history.Data;
+ }
+ catch (Exception e)
+ {
+ Utils.Debugging.Console.PrintLine("GetHistory()发生异常: {0}", e);
+ LogManager.Error("History", e);
+ return null;
+ }
+ }
+
+ }
+}
diff --git a/src/DownKyi.Core/BiliApi/History/Models/HistoryBusiness.cs b/src/DownKyi.Core/BiliApi/History/Models/HistoryBusiness.cs
new file mode 100644
index 0000000..0b40257
--- /dev/null
+++ b/src/DownKyi.Core/BiliApi/History/Models/HistoryBusiness.cs
@@ -0,0 +1,11 @@
+namespace DownKyi.Core.BiliApi.History.Models
+{
+ public enum HistoryBusiness
+ {
+ ARCHIVE = 1, // 稿件
+ PGC, // 番剧(影视)
+ LIVE, // 直播
+ ARTICLE_LIST, // 文集
+ ARTICLE, // 文章
+ }
+}
diff --git a/src/DownKyi.Core/BiliApi/History/Models/HistoryCursor.cs b/src/DownKyi.Core/BiliApi/History/Models/HistoryCursor.cs
new file mode 100644
index 0000000..c6641e7
--- /dev/null
+++ b/src/DownKyi.Core/BiliApi/History/Models/HistoryCursor.cs
@@ -0,0 +1,17 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.History.Models
+{
+ public class HistoryCursor : BaseModel
+ {
+ [JsonProperty("max")]
+ public long Max { get; set; }
+ [JsonProperty("view_at")]
+ public long ViewAt { get; set; }
+ [JsonProperty("business")]
+ public string Business { get; set; }
+ [JsonProperty("ps")]
+ public int Ps { get; set; }
+ }
+}
diff --git a/src/DownKyi.Core/BiliApi/History/Models/HistoryData.cs b/src/DownKyi.Core/BiliApi/History/Models/HistoryData.cs
new file mode 100644
index 0000000..ca58a5b
--- /dev/null
+++ b/src/DownKyi.Core/BiliApi/History/Models/HistoryData.cs
@@ -0,0 +1,28 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+
+namespace DownKyi.Core.BiliApi.History.Models
+{
+ // https://api.bilibili.com/x/web-interface/history/cursor?max={startId}&view_at={startTime}&ps={ps}&business={businessStr}
+ public class HistoryOrigin : BaseModel
+ {
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")]
+ public HistoryData Data { get; set; }
+ }
+
+ public class HistoryData : BaseModel
+ {
+ [JsonProperty("cursor")]
+ public HistoryCursor Cursor { get; set; }
+ //public List tab { get; set; }
+ [JsonProperty("list")]
+ public List List { get; set; }
+ }
+}
diff --git a/src/DownKyi.Core/BiliApi/History/Models/HistoryList.cs b/src/DownKyi.Core/BiliApi/History/Models/HistoryList.cs
new file mode 100644
index 0000000..5ac7372
--- /dev/null
+++ b/src/DownKyi.Core/BiliApi/History/Models/HistoryList.cs
@@ -0,0 +1,46 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.History.Models
+{
+ public class HistoryList : BaseModel
+ {
+ [JsonProperty("title")]
+ public string Title { get; set; }
+ // long_title
+ [JsonProperty("cover")]
+ public string Cover { get; set; }
+ // covers
+ [JsonProperty("uri")]
+ public string Uri { get; set; }
+ [JsonProperty("history")]
+ public HistoryListHistory History { get; set; }
+ [JsonProperty("videos")]
+ public int Videos { get; set; }
+ [JsonProperty("author_name")]
+ public string AuthorName { get; set; }
+ [JsonProperty("author_face")]
+ public string AuthorFace { get; set; }
+ [JsonProperty("author_mid")]
+ public long AuthorMid { get; set; }
+ [JsonProperty("view_at")]
+ public long ViewAt { get; set; }
+ [JsonProperty("progress")]
+ public long Progress { get; set; }
+ // badge
+ [JsonProperty("show_title")]
+ public string ShowTitle { get; set; }
+ [JsonProperty("duration")]
+ public long Duration { get; set; }
+ // current
+ // total
+ [JsonProperty("new_desc")]
+ public string NewDesc { get; set; }
+ // is_finish
+ // is_fav
+ // kid
+ [JsonProperty("tag_name")]
+ public string TagName { get; set; }
+ // live_status
+ }
+}
diff --git a/src/DownKyi.Core/BiliApi/History/Models/HistoryListHistory.cs b/src/DownKyi.Core/BiliApi/History/Models/HistoryListHistory.cs
new file mode 100644
index 0000000..8ea33f0
--- /dev/null
+++ b/src/DownKyi.Core/BiliApi/History/Models/HistoryListHistory.cs
@@ -0,0 +1,25 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.History.Models
+{
+ public class HistoryListHistory : BaseModel
+ {
+ [JsonProperty("oid")]
+ public long Oid { get; set; }
+ [JsonProperty("epid")]
+ public long Epid { get; set; }
+ [JsonProperty("bvid")]
+ public string Bvid { get; set; }
+ [JsonProperty("page")]
+ public int Page { get; set; }
+ [JsonProperty("cid")]
+ public long Cid { get; set; }
+ [JsonProperty("part")]
+ public string Part { get; set; }
+ [JsonProperty("business")]
+ public string Business { get; set; }
+ [JsonProperty("dt")]
+ public int Dt { get; set; }
+ }
+}
diff --git a/src/DownKyi.Core/BiliApi/History/Models/ToViewData.cs b/src/DownKyi.Core/BiliApi/History/Models/ToViewData.cs
new file mode 100644
index 0000000..5c1a7ac
--- /dev/null
+++ b/src/DownKyi.Core/BiliApi/History/Models/ToViewData.cs
@@ -0,0 +1,27 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+using System.Collections.Generic;
+
+namespace DownKyi.Core.BiliApi.History.Models
+{
+ // https://api.bilibili.com/x/v2/history/toview
+ public class ToViewOrigin : BaseModel
+ {
+ //[JsonProperty("code")]
+ //public int Code { get; set; }
+ //[JsonProperty("message")]
+ //public string Message { get; set; }
+ //[JsonProperty("ttl")]
+ //public int Ttl { get; set; }
+ [JsonProperty("data")]
+ public ToViewData Data { get; set; }
+ }
+
+ public class ToViewData : BaseModel
+ {
+ [JsonProperty("count")]
+ public int Count { get; set; }
+ [JsonProperty("list")]
+ public List List { get; set; }
+ }
+}
diff --git a/src/DownKyi.Core/BiliApi/History/Models/ToViewList.cs b/src/DownKyi.Core/BiliApi/History/Models/ToViewList.cs
new file mode 100644
index 0000000..4458a94
--- /dev/null
+++ b/src/DownKyi.Core/BiliApi/History/Models/ToViewList.cs
@@ -0,0 +1,43 @@
+using DownKyi.Core.BiliApi.Models;
+using Newtonsoft.Json;
+
+namespace DownKyi.Core.BiliApi.History.Models
+{
+ public class ToViewList : BaseModel
+ {
+ [JsonProperty("aid")]
+ public long Aid { get; set; }
+ // videos
+ // tid
+ // tname
+ // copyright
+ [JsonProperty("pic")]
+ public string Pic { get; set; }
+ [JsonProperty("title")]
+ public string Title { get; set; }
+ // pubdate
+ // ctime
+ // desc
+ // state
+ // duration
+ // rights
+ [JsonProperty("owner")]
+ public VideoOwner Owner { get; set; }
+ // stat
+ // dynamic
+ // dimension
+ // short_link_v2
+ // first_frame
+ // page
+ // count
+ [JsonProperty("cid")]
+ public long Cid { get; set; }
+ // progress
+ [JsonProperty("add_at")]
+ public long AddAt { get; set; }
+ [JsonProperty("bvid")]
+ public string Bvid { get; set; }
+ // uri
+ // viewed
+ }
+}
diff --git a/src/DownKyi.Core/BiliApi/History/ToView.cs b/src/DownKyi.Core/BiliApi/History/ToView.cs
new file mode 100644
index 0000000..354569b
--- /dev/null
+++ b/src/DownKyi.Core/BiliApi/History/ToView.cs
@@ -0,0 +1,38 @@
+using DownKyi.Core.BiliApi.History.Models;
+using DownKyi.Core.Logging;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+
+namespace DownKyi.Core.BiliApi.History
+{
+ ///
+ /// 稍后再看
+ ///
+ public static class ToView
+ {
+ ///
+ /// 获取稍后再看视频列表
+ ///
+ ///
+ public static List GetToView()
+ {
+ string url = "https://api.bilibili.com/x/v2/history/toview";
+ string referer = "https://www.bilibili.com";
+ string response = WebClient.RequestWeb(url, referer);
+
+ try
+ {
+ var toView = JsonConvert.DeserializeObject(response);
+ if (toView == null || toView.Data == null) { return null; }
+ return toView.Data.List;
+ }
+ catch (Exception e)
+ {
+ Utils.Debugging.Console.PrintLine("GetToView()发生异常: {0}", e);
+ LogManager.Error("ToView", e);
+ return null;
+ }
+ }
+ }
+}
diff --git a/src/DownKyi.Core/DownKyi.Core.csproj b/src/DownKyi.Core/DownKyi.Core.csproj
index fc516b6..fb65dfc 100644
--- a/src/DownKyi.Core/DownKyi.Core.csproj
+++ b/src/DownKyi.Core/DownKyi.Core.csproj
@@ -151,6 +151,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/DownKyi.Core/Storage/StorageHeader.cs b/src/DownKyi.Core/Storage/StorageHeader.cs
index 505272b..d38ff91 100644
--- a/src/DownKyi.Core/Storage/StorageHeader.cs
+++ b/src/DownKyi.Core/Storage/StorageHeader.cs
@@ -28,6 +28,7 @@ namespace DownKyi.Core.Storage
public BitmapImage GetHeaderThumbnail(long mid, string name, string url, int width, int height)
{
string header = GetHeader(mid, name, url);
+ if(header == null) { return null; }
return GetHeaderThumbnail(header, width, height);
}
diff --git a/src/DownKyi/App.xaml.cs b/src/DownKyi/App.xaml.cs
index ff95d7b..6a5d6a9 100644
--- a/src/DownKyi/App.xaml.cs
+++ b/src/DownKyi/App.xaml.cs
@@ -170,6 +170,8 @@ namespace DownKyi
containerRegistry.RegisterForNavigation(ViewMySpaceViewModel.Tag);
containerRegistry.RegisterForNavigation(ViewMyFavoritesViewModel.Tag);
containerRegistry.RegisterForNavigation(ViewMyBangumiFollowViewModel.Tag);
+ containerRegistry.RegisterForNavigation(ViewMyToViewVideoViewModel.Tag);
+ containerRegistry.RegisterForNavigation(ViewMyHistoryViewModel.Tag);
// downloadManager pages
containerRegistry.RegisterForNavigation(ViewDownloadingViewModel.Tag);
diff --git a/src/DownKyi/DownKyi.csproj b/src/DownKyi/DownKyi.csproj
index 7013f51..1ee1080 100644
--- a/src/DownKyi/DownKyi.csproj
+++ b/src/DownKyi/DownKyi.csproj
@@ -104,8 +104,10 @@
+
+
@@ -155,7 +157,9 @@
+
+
@@ -226,9 +230,15 @@
ViewMyFavorites.xaml
+
+ ViewMyHistory.xaml
+
ViewMySpace.xaml
+
+ ViewMyToViewVideo.xaml
+
ViewPublication.xaml
@@ -415,10 +425,18 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/src/DownKyi/Images/NormalIcon.cs b/src/DownKyi/Images/NormalIcon.cs
index bd21580..7977bf2 100644
--- a/src/DownKyi/Images/NormalIcon.cs
+++ b/src/DownKyi/Images/NormalIcon.cs
@@ -266,6 +266,73 @@
q-13.21 7.16 -14.32 22.57 l0 259.85 q1.11 15.42 14.32 22.57 q13.21 7.16 26.42 -1.65 l186.09 -129.92 Z",
Fill = "#FF000000"
};
+
+ PlatformIpad = new VectorImage
+ {
+ Height = 16,
+ Width = 16,
+ Data = @"M804.57 0 q40 0 73.72 19.43 q33.71 19.43 53.14 53.15 q19.43 33.72 19.43 73.71 l0 731.42 q0 40 -19.43 73.71
+ q-19.43 33.72 -53.14 53.14 q-33.72 19.43 -73.72 19.43 l-585.14 0 q-40 0 -73.72 -19.43 q-33.72 -19.43 -53.15 -53.14
+ q-19.43 -33.71 -19.43 -73.71 l0 -731.42 q0 -40 19.43 -73.71 q19.43 -33.72 53.15 -53.15 q33.72 -19.43 73.72 -19.43
+ l585.14 0 ZM512 877.71 q-22.86 0 -38.86 16 q-16 16 -16 38.86 q0 22.86 16 38.86 q16 16 38.86 16 q22.86 0 38.86 -16
+ q16 -16 16 -38.86 q0 -22.86 -16 -38.86 q-16 -16 -38.86 -16 ZM804.57 73.14 l-585.14 0 q-27.43 0 -48.57 18.28
+ q-21.15 18.28 -24.57 46.86 l0 8 l0 621.71 q0 27.43 18.28 48.57 q18.29 21.14 46.86 24.57 l8 0 l585.14 0
+ q27.43 0 48.57 -18.28 q21.14 -18.28 24.57 -46.86 l0 -8 l0 -621.71 q0 -30.86 -21.14 -52 q-21.14 -21.14 -52 -21.14 Z",
+ Fill = "#FF000000"
+ };
+
+ PlatformMobile = new VectorImage
+ {
+ Height = 16,
+ Width = 16,
+ Data = @"M694.86 0 q40 0 73.72 19.43 q33.71 19.43 53.14 53.15 q19.43 33.72 19.43 73.71 l0 731.42 q0 40 -19.43 73.71
+ q-19.42 33.72 -53.14 53.14 q-33.72 19.43 -73.72 19.43 l-365.72 0 q-40 0 -73.71 -19.43 q-33.72 -19.43 -53.14 -53.14
+ q-19.43 -33.71 -19.43 -73.71 l0 -731.42 q0 -40 19.43 -73.71 q19.42 -33.72 53.14 -53.15 q33.71 -19.43 73.71 -19.43
+ l365.72 0 ZM512 877.71 q-22.86 0 -38.86 16 q-16 16 -16 38.86 q0 22.86 16 38.86 q16 16 38.86 16 q22.86 0 38.86 -16
+ q16 -16 16 -38.86 q0 -22.86 -16 -38.86 q-16 -16 -38.86 -16 ZM694.86 73.14 l-365.72 0 q-27.43 0 -48.57 18.28
+ q-21.14 18.28 -24.57 46.86 l0 8 l0 621.71 q0 27.43 18.28 48.57 q18.29 21.14 46.86 24.57 l8 0 l365.72 0
+ q27.43 0 48.57 -18.28 q21.14 -18.28 24.57 -46.86 l0 -8 l0 -621.71 q0 -30.86 -21.14 -52 q-21.14 -21.14 -52 -21.14 Z",
+ Fill = "#FF000000"
+ };
+
+ PlatformPC = new VectorImage
+ {
+ Height = 16,
+ Width = 16,
+ Data = @"M694.86 804.57 q14.85 0 25.71 10.86 q10.86 10.86 10.86 25.71 q0 14.86 -10.86 25.71 q-10.86 10.86 -25.71 10.86
+ l-365.72 0 q-14.85 0 -25.71 -10.86 q-10.86 -10.86 -10.86 -25.71 q0 -14.86 10.86 -25.71 q10.86 -10.86 25.71 -10.86
+ l365.72 0 ZM877.71 0 q40 0 73.71 19.43 q33.72 19.43 53.14 53.15 q19.43 33.72 19.43 73.71 l0 438.85 q0 40 -19.43 73.72
+ q-19.43 33.72 -53.14 53.14 q-33.71 19.43 -73.71 19.43 l-731.42 0 q-40 0 -73.71 -19.43 q-33.72 -19.43 -53.15 -53.14
+ q-19.43 -33.72 -19.43 -73.72 l0 -438.85 q0 -40 19.43 -73.71 q19.43 -33.72 53.15 -53.15 q33.72 -19.43 73.71 -19.43
+ l731.42 0 ZM877.71 73.14 l-731.42 0 q-27.43 0 -48.57 18.28 q-21.15 18.28 -24.58 46.86 l0 8 l0 438.85
+ q0 27.43 18.28 48.58 q18.28 21.14 46.86 24.57 l8 0 l731.42 0 q27.43 0 48.57 -18.29 q21.14 -18.29 24.58 -46.86
+ l0 -8 l0 -438.85 q0 -30.86 -21.14 -52 q-21.14 -21.14 -52 -21.14 ZM347.43 182.86 q34.28 0 63.99 17.14
+ q29.72 17.14 46.86 46.85 q17.15 29.72 17.15 64 q0 34.28 -17.15 64 q-17.14 29.71 -46.86 46.86
+ q-29.71 17.14 -63.99 17.14 l-91.43 0 l0 109.71 l-73.14 0 l0 -365.71 l164.57 0 ZM694.86 182.86
+ q44.57 0 82.85 19.43 q38.29 19.42 63.43 53.71 l-60.57 41.14 q-22.86 -27.43 -56 -37.14 q-33.14 -9.71 -66.28 2.29
+ q-33.14 12 -53.14 40.57 q-20 28.57 -20 62.86 q0 34.28 20 62.85 q20 28.57 53.14 40.57 q33.14 12 66.28 2.28
+ q33.14 -9.71 56 -37.13 l60.57 41.14 q-38.85 51.43 -101.14 67.43 q-62.29 16 -121.14 -10.86
+ q-58.86 -26.86 -87.42 -84.58 q-28.57 -57.71 -14.86 -120.57 q13.71 -62.86 64 -103.43 q50.28 -40.57 114.28 -40.57
+ ZM347.43 256 l-91.43 0 l0 109.71 l91.43 0 q22.86 0 38.86 -16 q16 -16 16 -38.85 q0 -22.86 -16 -38.86 q-16 -16 -38.86 -16 Z",
+ Fill = "#FF000000"
+ };
+
+ PlatformTV = new VectorImage
+ {
+ Height = 16,
+ Width = 16,
+ Data = @"M768 804.57 q14.86 0 25.72 10.86 q10.86 10.86 10.86 25.71 q0 14.86 -10.86 25.71 q-10.86 10.86 -25.72 10.86
+ l-512 0 q-14.86 0 -25.72 -10.86 q-10.85 -10.86 -10.85 -25.71 q0 -14.86 10.85 -25.71 q10.85 -10.86 25.72 -10.86
+ l512 0 ZM877.71 0 q40 0 73.71 19.43 q33.72 19.43 53.14 53.15 q19.43 33.72 19.43 73.71 l0 438.85 q0 40 -19.43 73.72
+ q-19.43 33.72 -53.14 53.14 q-33.71 19.43 -73.71 19.43 l-731.42 0 q-40 0 -73.71 -19.43 q-33.72 -19.43 -53.15 -53.14
+ q-19.43 -33.72 -19.43 -73.72 l0 -438.85 q0 -40 19.43 -73.71 q19.43 -33.72 53.15 -53.15 q33.72 -19.43 73.71 -19.43
+ l731.42 0 ZM877.71 73.14 l-731.42 0 q-27.43 0 -48.57 18.28 q-21.15 18.28 -24.58 46.86 l0 8 l0 438.85
+ q0 27.43 18.28 48.58 q18.28 21.14 46.86 24.57 l8 0 l731.42 0 q27.43 0 48.57 -18.29 q21.14 -18.29 24.58 -46.86
+ l0 -8 l0 -438.85 q0 -30.86 -21.14 -52 q-21.14 -21.14 -52 -21.14 ZM585.14 182.86 l109.72 274.28 l109.71 -274.28
+ l73.14 0 l-146.28 365.71 l-73.14 0 l-116.58 -292.57 l-176 0 l0 292.57 l-73.14 0 l0 -292.57 l-146.28 0 l0 -73.14 l438.85 0 Z",
+ Fill = "#FF000000"
+ };
+
}
public VectorImage Play { get; private set; }
@@ -290,5 +357,11 @@
public VectorImage VideoUp { get; private set; }
public VectorImage Channel { get; private set; }
+
+ public VectorImage PlatformIpad { get; private set; }
+ public VectorImage PlatformMobile { get; private set; }
+ public VectorImage PlatformPC { get; private set; }
+ public VectorImage PlatformTV { get; private set; }
+
}
}
diff --git a/src/DownKyi/Languages/Default.xaml b/src/DownKyi/Languages/Default.xaml
index c3a5163..ea63788 100644
--- a/src/DownKyi/Languages/Default.xaml
+++ b/src/DownKyi/Languages/Default.xaml
@@ -82,6 +82,15 @@
追剧
尚未观看
+
+ 历史记录
+ 已看完
+ 刚开始
+ 看到
+
+
+ 稍后再看
+
下载选中项
下载全部
diff --git a/src/DownKyi/Services/FavoritesService.cs b/src/DownKyi/Services/FavoritesService.cs
index 4c7f4f2..a04bfe8 100644
--- a/src/DownKyi/Services/FavoritesService.cs
+++ b/src/DownKyi/Services/FavoritesService.cs
@@ -156,7 +156,7 @@ namespace DownKyi.Services
FavoriteNumber = media.CntInfo != null ? Format.FormatNumber(media.CntInfo.Collect) : "0",
Duration = Format.FormatDuration2(media.Duration),
UpName = media.Upper != null ? media.Upper.Name : string.Empty,
- UpperMid = media.Upper != null ? media.Upper.Mid : -1,
+ UpMid = media.Upper != null ? media.Upper.Mid : -1,
CreateTime = ctime,
FavTime = favTime
};
diff --git a/src/DownKyi/ViewModels/PageViewModels/FavoritesMedia.cs b/src/DownKyi/ViewModels/PageViewModels/FavoritesMedia.cs
index ea8f972..4c8e56a 100644
--- a/src/DownKyi/ViewModels/PageViewModels/FavoritesMedia.cs
+++ b/src/DownKyi/ViewModels/PageViewModels/FavoritesMedia.cs
@@ -18,7 +18,7 @@ namespace DownKyi.ViewModels.PageViewModels
public long Avid { get; set; }
public string Bvid { get; set; }
- public long UpperMid { get; set; }
+ public long UpMid { get; set; }
#region 页面属性申明
@@ -130,7 +130,7 @@ namespace DownKyi.ViewModels.PageViewModels
{
if (!(parameter is string tag)) { return; }
- NavigateToView.NavigateToViewUserSpace(eventAggregator, tag, UpperMid);
+ NavigateToView.NavigateToViewUserSpace(eventAggregator, tag, UpMid);
}
#endregion
diff --git a/src/DownKyi/ViewModels/PageViewModels/HistoryMedia.cs b/src/DownKyi/ViewModels/PageViewModels/HistoryMedia.cs
new file mode 100644
index 0000000..36d1a9b
--- /dev/null
+++ b/src/DownKyi/ViewModels/PageViewModels/HistoryMedia.cs
@@ -0,0 +1,175 @@
+using DownKyi.Images;
+using DownKyi.Utils;
+using Prism.Commands;
+using Prism.Events;
+using Prism.Mvvm;
+using System.Windows;
+using System.Windows.Media.Imaging;
+
+namespace DownKyi.ViewModels.PageViewModels
+{
+ public class HistoryMedia : BindableBase
+ {
+ protected readonly IEventAggregator eventAggregator;
+
+ public HistoryMedia(IEventAggregator eventAggregator)
+ {
+ this.eventAggregator = eventAggregator;
+ }
+
+ // bvid
+ public string Bvid { get; set; }
+
+ // 播放url
+ public string Url { get; set; }
+
+ // UP主的mid
+ public long UpMid { get; set; }
+
+ // 类型
+ public string Business { get; set; }
+
+ #region 页面属性申明
+
+ // 是否选中
+ private bool isSelected;
+ public bool IsSelected
+ {
+ get => isSelected;
+ set => SetProperty(ref isSelected, value);
+ }
+
+ // 封面
+ private BitmapImage cover;
+ public BitmapImage Cover
+ {
+ get => cover;
+ set => SetProperty(ref cover, value);
+ }
+
+ // 视频标题
+ private string title;
+ public string Title
+ {
+ get => title;
+ set => SetProperty(ref title, value);
+ }
+
+ // 分P的标题
+ private string subTitle;
+ public string SubTitle
+ {
+ get => subTitle;
+ set => SetProperty(ref subTitle, value);
+ }
+
+ // 时长
+ private long duration;
+ public long Duration
+ {
+ get => duration;
+ set => SetProperty(ref duration, value);
+ }
+
+ // tag标签
+ private string tagName;
+ public string TagName
+ {
+ get => tagName;
+ set => SetProperty(ref tagName, value);
+ }
+
+ // new_desc 剧集或分P描述
+ private string partdesc;
+ public string Partdesc
+ {
+ get => partdesc;
+ set => SetProperty(ref partdesc, value);
+ }
+
+ // 观看进度
+ private string progress;
+ public string Progress
+ {
+ get => progress;
+ set => SetProperty(ref progress, value);
+ }
+
+ // 观看平台
+ private VectorImage platform;
+ public VectorImage Platform
+ {
+ get => platform;
+ set => SetProperty(ref platform, value);
+ }
+
+ // UP主的昵称
+ private string upName;
+ public string UpName
+ {
+ get => upName;
+ set => SetProperty(ref upName, value);
+ }
+
+ // UP主的头像
+ private BitmapImage upHeader;
+ public BitmapImage UpHeader
+ {
+ get => upHeader;
+ set => SetProperty(ref upHeader, value);
+ }
+
+ // 是否显示Partdesc
+ private Visibility partdescVisibility;
+ public Visibility PartdescVisibility
+ {
+ get => partdescVisibility;
+ set => SetProperty(ref partdescVisibility, value);
+ }
+
+ // 是否显示UP主信息和分区信息
+ private Visibility upAndTagVisibility;
+ public Visibility UpAndTagVisibility
+ {
+ get => upAndTagVisibility;
+ set => SetProperty(ref upAndTagVisibility, value);
+ }
+
+ #endregion
+
+ #region 命令申明
+
+ // 视频标题点击事件
+ private DelegateCommand