Skip to content

Commit

Permalink
#933 整理部分业务代码,修复番剧点评相关api错误
Browse files Browse the repository at this point in the history
  • Loading branch information
ywmoyue committed Dec 7, 2024
1 parent e134fb7 commit fe19152
Show file tree
Hide file tree
Showing 59 changed files with 1,877 additions and 1,675 deletions.
37 changes: 31 additions & 6 deletions src/BiliLite.UWP/BiliLite.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,30 @@
<Compile Include="Models\Common\Home\CinemaHomeFallModel.cs" />
<Compile Include="Models\Common\Home\RegionChildrenItem.cs" />
<Compile Include="Models\Common\Home\RegionItem.cs" />
<Compile Include="Models\Common\Other\FindMoreEntranceModel.cs" />
<Compile Include="Models\Common\Favorites\FavoriteDetailModel.cs" />
<Compile Include="Models\Common\Favorites\FavoriteInfoModel.cs" />
<Compile Include="Models\Common\Favorites\FavoriteInfoVideoItemModel.cs" />
<Compile Include="Models\Common\Favorites\FavoriteInfoVideoItemStatModel.cs" />
<Compile Include="Models\Common\Favorites\FavoriteInfoVideoItemUpperModel.cs" />
<Compile Include="Models\Common\Anime\AnimeTimelineItemModel.cs" />
<Compile Include="Models\Common\Anime\AnimeTimelineModel.cs" />
<Compile Include="Models\Common\Anime\AnimeTypeItem.cs" />
<Compile Include="Models\Common\Season\SeasonShortReviewItemAuthorModel.cs" />
<Compile Include="Models\Common\Season\SeasonShortReviewItemModel.cs" />
<Compile Include="Models\Common\Season\SeasonShortReviewItemStatModel.cs" />
<Compile Include="Models\Common\Season\SeasonIndexConditionFilterItemModel.cs" />
<Compile Include="Models\Common\Season\SeasonIndexConditionFilterModel.cs" />
<Compile Include="Models\Common\Season\SeasonIndexParameter.cs" />
<Compile Include="Models\Common\Season\SeasonIndexResultItemModel.cs" />
<Compile Include="Models\Common\Season\SeasonIndexResultItemOrderModel.cs" />
<Compile Include="ViewModels\Season\SeasonShortReviewItemStatViewModel.cs" />
<Compile Include="ViewModels\Season\SeasonShortReviewItemViewModel.cs" />
<Compile Include="Models\Common\Season\SeasonShortReviewItemVIPModel.cs" />
<Compile Include="ViewModels\Season\SeasonRankDataViewModel.cs" />
<Compile Include="Models\Common\Season\SeasonRankItemModel.cs" />
<Compile Include="Models\Common\Season\SeasonRankItemNewEPModel.cs" />
<Compile Include="Models\Common\Season\SeasonRankItemStatModel.cs" />
<Compile Include="ViewModels\Region\IRegionViewModel.cs" />
<Compile Include="Models\Common\Region\RegionChildOrderModel.cs" />
<Compile Include="ViewModels\Region\RegionDetailChildViewModel.cs" />
Expand Down Expand Up @@ -820,7 +844,7 @@
<Compile Include="Models\Responses\LoginAppThirdResponse.cs" />
<Compile Include="Models\ReturnModel.cs" />
<Compile Include="Models\UserModels.cs" />
<Compile Include="Modules\Detail\FavoriteDetailVM.cs" />
<Compile Include="ViewModels\Favourites\FavoriteDetailViewModel.cs" />
<Compile Include="ViewModels\EmoteViewModel.cs" />
<Compile Include="ViewModels\Home\RegionViewModel.cs" />
<Compile Include="Modules\Live\LiveAreaDetailVM.cs" />
Expand All @@ -831,17 +855,17 @@
<Compile Include="Modules\Live\LiveCenter\LiveCenterVM.cs" />
<Compile Include="Modules\Live\LiveMessage.cs" />
<Compile Include="Modules\Live\LiveRecommendVM.cs" />
<Compile Include="Modules\Other\FindMoreVM.cs" />
<Compile Include="ViewModels\Other\FindMoreViewModel.cs" />
<Compile Include="Modules\Player\InteractionVideoVM.cs" />
<Compile Include="Modules\Player\Playurl\BiliPlayUrlRequest.cs" />
<Compile Include="Modules\Player\Playurl\BiliPlayUrl.cs" />
<Compile Include="Models\Common\Video\PlayUrlInfos\BiliFlvPlayUrlInfo.cs" />
<Compile Include="ViewModels\Region\RegionDetailViewModel.cs" />
<Compile Include="Models\Common\Search\SearchFilterItem.cs" />
<Compile Include="Modules\Season\SeasonRankVM.cs" />
<Compile Include="Modules\Season\SeasonReviewVM.cs" />
<Compile Include="ViewModels\Season\SeasonRankViewModel.cs" />
<Compile Include="ViewModels\Season\SeasonReviewViewModel.cs" />
<Compile Include="Modules\User\Account.cs" />
<Compile Include="Modules\Season\AnimeTimelineVM.cs" />
<Compile Include="ViewModels\Season\AnimeTimelineViewModel.cs" />
<Compile Include="ViewModels\Home\AnimePageViewModel.cs" />
<Compile Include="ViewModels\Home\CinemaViewModel.cs" />
<Compile Include="ViewModels\Home\DynamicPageViewModel.cs" />
Expand All @@ -861,7 +885,7 @@
<Compile Include="ViewModels\Home\RecommendPageViewModel.cs" />
<Compile Include="Modules\RelayCommand.cs" />
<Compile Include="ViewModels\Season\SeasonDetailPageViewModel.cs" />
<Compile Include="Modules\Season\SeasonIndexVM.cs" />
<Compile Include="ViewModels\Season\SeasonIndexViewModel.cs" />
<Compile Include="ViewModels\Video\VideoDetailPageViewModel.cs" />
<Compile Include="ViewModels\User\MyFollowVideoViewModel.cs" />
<Compile Include="ViewModels\User\SendDynamic\SendDynamicViewModel.cs" />
Expand Down Expand Up @@ -1654,6 +1678,7 @@
<Folder Include="Assets\Tools\" />
<Folder Include="Models\Plugins\" />
<Folder Include="Models\Requests\Api\Grpc\" />
<Folder Include="Modules\Season\" />
<Folder Include="Modules\User\SendDynamic\" />
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/BiliLite.UWP/Dialogs/CopyOrMoveFavVideoDialog.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using BiliLite.Models;
using BiliLite.Models.Requests.Api.User;
using BiliLite.Modules;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using BiliLite.Extensions;
using BiliLite.Models.Common.Favorites;
using BiliLite.Models.Responses;
using BiliLite.ViewModels.User;

Expand Down Expand Up @@ -44,7 +44,7 @@ private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, Conten
List<string> ids = new List<string>();
foreach (var videoItem in selectItems)
{
ids.Add(videoItem.id);
ids.Add(videoItem.Id);
}
if (isMove)
{
Expand Down
12 changes: 7 additions & 5 deletions src/BiliLite.UWP/Dialogs/SendReviewDialog.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
using BiliLite.Extensions;
using BiliLite.Modules.Season;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using BiliLite.ViewModels.Season;
using Microsoft.Extensions.DependencyInjection;

// https://go.microsoft.com/fwlink/?LinkId=234238 上介绍了“内容对话框”项模板

namespace BiliLite.Dialogs
{
public sealed partial class SendReviewDialog : ContentDialog
{
SeasonReviewVM seasonReviewVM;
private readonly SeasonReviewViewModel m_viewModel;

public SendReviewDialog(int mediaId)
{
m_viewModel = App.ServiceProvider.GetRequiredService<SeasonReviewViewModel>();
m_viewModel.MediaID = mediaId;
this.InitializeComponent();
seasonReviewVM = new SeasonReviewVM();
seasonReviewVM.MediaID = mediaId;
}

private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
Expand All @@ -25,7 +27,7 @@ private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, Conten
return;
}
int score = (int)rating.Value * 2;
var result = await seasonReviewVM.SendShortReview(txtBoxContent.Text, checkShare.IsChecked.Value, score);
var result = await m_viewModel.SendShortReview(txtBoxContent.Text, checkShare.IsChecked.Value, score);
if (result)
{
this.Hide();
Expand Down
6 changes: 4 additions & 2 deletions src/BiliLite.UWP/Extensions/MapperExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ public static IServiceCollection AddMapper(this IServiceCollection services)
expression.CreateMap<FollowTlistItemModel, UserRelationFollowingTagViewModel>();
expression.CreateMap<VideoListSection, VideoListSectionViewModel>();
expression.CreateMap<VideoPlaylistItem,VideoListItem>();
expression.CreateMap<FavoriteItemModel, FavoriteItemViewModel>();
expression.CreateMap<CinemaHomeModel, CinemaHomeViewModel>();
expression.CreateMap<FavoriteItemModel, FavoriteItemViewModel>();
expression.CreateMap<CinemaHomeModel, CinemaHomeViewModel>();
expression.CreateMap<CinemaHomeFallModel, CinemaHomeFallViewModel>();
expression.CreateMap<SeasonShortReviewItemModel, SeasonShortReviewItemViewModel>();
expression.CreateMap<SeasonShortReviewItemStatModel, SeasonShortReviewItemStatViewModel>();
expression.CreateMap<MediaListItem, VideoListItem>()
.ForMember(dest => dest.Author,
opt => opt.MapFrom(src =>
Expand Down
22 changes: 22 additions & 0 deletions src/BiliLite.UWP/Models/Common/Anime/AnimeTimelineItemModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Newtonsoft.Json;

namespace BiliLite.Models.Common.Anime;

public class AnimeTimelineItemModel : ISeasonItem
{
[JsonProperty("season_id")]
public int SeasonId { get; set; }

public string Cover { get; set; }

[JsonProperty("square_cover")]
public string SquareCover { get; set; }

[JsonProperty("pub_index")]
public string PubIndex { get; set; }

[JsonProperty("pub_time")]
public string PubTime { get; set; }

public string Title { get; set; }
}
19 changes: 19 additions & 0 deletions src/BiliLite.UWP/Models/Common/Anime/AnimeTimelineModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace BiliLite.Models.Common.Anime;

public class AnimeTimelineModel
{
public string Week { get; set; }

[JsonProperty("day_week")]
public int DayWeek { get; set; }

public string Date { get; set; }

[JsonProperty("is_today")]
public bool IsToday { get; set; }

public List<AnimeTimelineItemModel> Seasons { get; set; }
}
8 changes: 8 additions & 0 deletions src/BiliLite.UWP/Models/Common/Anime/AnimeTypeItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace BiliLite.Models.Common.Anime;

public class AnimeTypeItem
{
public string Name { get; set; }

public AnimeType AnimeType { get; set; }
}
10 changes: 10 additions & 0 deletions src/BiliLite.UWP/Models/Common/Enumerates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -561,4 +561,14 @@ public enum SearchType
/// </summary>
Topic = 7
}

public enum IndexSeasonType
{
Anime = 1,
Movie = 2,
Documentary = 3,
Guochuang = 4,
TV = 5,
Variety = 7
}
}
11 changes: 11 additions & 0 deletions src/BiliLite.UWP/Models/Common/Favorites/FavoriteDetailModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Collections.Generic;
using BiliLite.Modules;

namespace BiliLite.Models.Common.Favorites;

public class FavoriteDetailModel
{
public FavoriteInfoModel Info { get; set; }

public List<FavoriteInfoVideoItemModel> Medias { get; set; }
}
32 changes: 32 additions & 0 deletions src/BiliLite.UWP/Models/Common/Favorites/FavoriteInfoModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Newtonsoft.Json;

namespace BiliLite.Models.Common.Favorites;

public class FavoriteInfoModel
{
public string Cover { get; set; }

public int Attr { get; set; }

public bool Privacy => Attr == 2;

public string Fid { get; set; }

public string Id { get; set; }

[JsonProperty("like_state")]
public int LikeState { get; set; }

[JsonProperty("fav_state")]
public int FavState { get; set; }

public string Mid { get; set; }

public string Title { get; set; }
public int Type { get; set; }

[JsonProperty("media_count")]
public int MediaCount { get; set; }

public FavoriteInfoVideoItemUpperModel Upper { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Newtonsoft.Json;

namespace BiliLite.Models.Common.Favorites;

public class FavoriteInfoVideoItemModel
{
public string Id { get; set; }

public string Cover { get; set; }

public string Title { get; set; }

public FavoriteInfoVideoItemUpperModel Upper { get; set; }

[JsonProperty("cnt_info")]
public FavoriteInfoVideoItemStatModel CntInfo { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace BiliLite.Models.Common.Favorites;

public class FavoriteInfoVideoItemStatModel
{
public int Coin { get; set; }

public int Collect { get; set; }

public int Danmaku { get; set; }

public int Play { get; set; }

public int Reply { get; set; }

public int Share { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace BiliLite.Models.Common.Favorites;

public class FavoriteInfoVideoItemUpperModel
{
public string Face { get; set; }

public string Name { get; set; }

public string Mid { get; set; }
}
14 changes: 14 additions & 0 deletions src/BiliLite.UWP/Models/Common/Other/FindMoreEntranceModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace BiliLite.Models.Common.Other;

public class FindMoreEntranceModel
{
public string Name { get; set; }

public string Desc { get; set; }

public int Type { get; set; }

public string Link { get; set; }

public string Pic { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace BiliLite.Models.Common.Season;

public class SeasonIndexConditionFilterItemModel
{
public string Keyword { get; set; }

public string Name { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Collections.Generic;

namespace BiliLite.Models.Common.Season;

public class SeasonIndexConditionFilterModel
{
public string Field { get; set; }

public string Name { get; set; }

public SeasonIndexConditionFilterItemModel Current { get; set; }

public List<SeasonIndexConditionFilterItemModel> Values { get; set; }
}
16 changes: 16 additions & 0 deletions src/BiliLite.UWP/Models/Common/Season/SeasonIndexParameter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace BiliLite.Models.Common.Season;

public class SeasonIndexParameter
{
public IndexSeasonType Type { get; set; } = IndexSeasonType.Anime;

public string Area { get; set; } = "-1";

public string Style { get; set; } = "-1";

public string Year { get; set; } = "-1";

public string Month { get; set; } = "-1";

public string Order { get; set; } = "3";
}
Loading

0 comments on commit fe19152

Please sign in to comment.