|
|
|
@ -1,10 +1,10 @@
|
|
|
|
|
using DownKyi.Core.BiliApi.BiliUtils;
|
|
|
|
|
using DownKyi.Core.BiliApi.Users;
|
|
|
|
|
using DownKyi.Core.BiliApi.Users;
|
|
|
|
|
using DownKyi.Core.Logging;
|
|
|
|
|
using DownKyi.Core.Settings;
|
|
|
|
|
using DownKyi.Core.Settings.Models;
|
|
|
|
|
using DownKyi.Core.Storage;
|
|
|
|
|
using DownKyi.Images;
|
|
|
|
|
using DownKyi.Services;
|
|
|
|
|
using DownKyi.Utils;
|
|
|
|
|
using Prism.Commands;
|
|
|
|
|
using Prism.Events;
|
|
|
|
@ -222,74 +222,12 @@ namespace DownKyi.ViewModels
|
|
|
|
|
|
|
|
|
|
LogManager.Debug(Tag, $"InputText: {InputText}");
|
|
|
|
|
|
|
|
|
|
// 视频
|
|
|
|
|
if (ParseEntrance.IsAvId(InputText))
|
|
|
|
|
{
|
|
|
|
|
NavigateToView.NavigationView(eventAggregator, ViewVideoDetailViewModel.Tag, Tag, $"{ParseEntrance.VideoUrl}{InputText.ToLower()}");
|
|
|
|
|
}
|
|
|
|
|
else if (ParseEntrance.IsAvUrl(InputText))
|
|
|
|
|
{
|
|
|
|
|
NavigateToView.NavigationView(eventAggregator, ViewVideoDetailViewModel.Tag, Tag, InputText);
|
|
|
|
|
}
|
|
|
|
|
else if (ParseEntrance.IsBvId(InputText))
|
|
|
|
|
{
|
|
|
|
|
NavigateToView.NavigationView(eventAggregator, ViewVideoDetailViewModel.Tag, Tag, $"{ParseEntrance.VideoUrl}{InputText}");
|
|
|
|
|
}
|
|
|
|
|
else if (ParseEntrance.IsBvUrl(InputText))
|
|
|
|
|
{
|
|
|
|
|
NavigateToView.NavigationView(eventAggregator, ViewVideoDetailViewModel.Tag, Tag, InputText);
|
|
|
|
|
}
|
|
|
|
|
// 番剧(电影、电视剧)
|
|
|
|
|
else if (ParseEntrance.IsBangumiSeasonId(InputText))
|
|
|
|
|
{
|
|
|
|
|
NavigateToView.NavigationView(eventAggregator, ViewVideoDetailViewModel.Tag, Tag, $"{ParseEntrance.BangumiUrl}{InputText.ToLower()}");
|
|
|
|
|
}
|
|
|
|
|
else if (ParseEntrance.IsBangumiSeasonUrl(InputText))
|
|
|
|
|
{
|
|
|
|
|
NavigateToView.NavigationView(eventAggregator, ViewVideoDetailViewModel.Tag, Tag, InputText);
|
|
|
|
|
}
|
|
|
|
|
else if (ParseEntrance.IsBangumiEpisodeId(InputText))
|
|
|
|
|
{
|
|
|
|
|
NavigateToView.NavigationView(eventAggregator, ViewVideoDetailViewModel.Tag, Tag, $"{ParseEntrance.BangumiUrl}{InputText.ToLower()}");
|
|
|
|
|
}
|
|
|
|
|
else if (ParseEntrance.IsBangumiEpisodeUrl(InputText))
|
|
|
|
|
{
|
|
|
|
|
NavigateToView.NavigationView(eventAggregator, ViewVideoDetailViewModel.Tag, Tag, InputText);
|
|
|
|
|
}
|
|
|
|
|
else if (ParseEntrance.IsBangumiMediaId(InputText))
|
|
|
|
|
{
|
|
|
|
|
NavigateToView.NavigationView(eventAggregator, ViewVideoDetailViewModel.Tag, Tag, $"{ParseEntrance.BangumiMediaUrl}{InputText.ToLower()}");
|
|
|
|
|
}
|
|
|
|
|
else if (ParseEntrance.IsBangumiMediaUrl(InputText))
|
|
|
|
|
{
|
|
|
|
|
NavigateToView.NavigationView(eventAggregator, ViewVideoDetailViewModel.Tag, Tag, InputText);
|
|
|
|
|
}
|
|
|
|
|
// 课程
|
|
|
|
|
else if (ParseEntrance.IsCheeseSeasonUrl(InputText) || ParseEntrance.IsCheeseEpisodeUrl(InputText))
|
|
|
|
|
{
|
|
|
|
|
NavigateToView.NavigationView(eventAggregator, ViewVideoDetailViewModel.Tag, Tag, InputText);
|
|
|
|
|
}
|
|
|
|
|
// 用户(参数传入mid)
|
|
|
|
|
else if (ParseEntrance.IsUserId(InputText))
|
|
|
|
|
{
|
|
|
|
|
NavigateToView.NavigateToViewUserSpace(eventAggregator, Tag, ParseEntrance.GetUserId(InputText));
|
|
|
|
|
}
|
|
|
|
|
else if (ParseEntrance.IsUserUrl(InputText))
|
|
|
|
|
{
|
|
|
|
|
NavigateToView.NavigateToViewUserSpace(eventAggregator, Tag, ParseEntrance.GetUserId(InputText));
|
|
|
|
|
}
|
|
|
|
|
// 收藏夹
|
|
|
|
|
else if (ParseEntrance.IsFavoritesId(InputText))
|
|
|
|
|
{
|
|
|
|
|
NavigateToView.NavigationView(eventAggregator, ViewPublicFavoritesViewModel.Tag, Tag, ParseEntrance.GetFavoritesId(InputText));
|
|
|
|
|
}
|
|
|
|
|
else if (ParseEntrance.IsFavoritesUrl(InputText))
|
|
|
|
|
{
|
|
|
|
|
NavigateToView.NavigationView(eventAggregator, ViewPublicFavoritesViewModel.Tag, Tag, ParseEntrance.GetFavoritesId(InputText));
|
|
|
|
|
}
|
|
|
|
|
// TODO 关键词搜索
|
|
|
|
|
else
|
|
|
|
|
SearchService searchService = new SearchService();
|
|
|
|
|
bool isSupport = searchService.BiliInput(InputText, Tag, eventAggregator);
|
|
|
|
|
if (!isSupport)
|
|
|
|
|
{
|
|
|
|
|
// 关键词搜索
|
|
|
|
|
searchService.SearchKey(InputText, Tag, eventAggregator);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InputText = string.Empty;
|
|
|
|
|