Skip to content

Commit

Permalink
Merge pull request #834 from ywmoyue/dev
Browse files Browse the repository at this point in the history
4.7.4
  • Loading branch information
ywmoyue authored Sep 30, 2024
2 parents d69af1b + 56acfcf commit 99c5a9d
Show file tree
Hide file tree
Showing 47 changed files with 1,627 additions and 752 deletions.
2 changes: 1 addition & 1 deletion src/BiliLite.Packages/BiliLite.Packages.wapproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<NoWarn>$(NoWarn);NU1702</NoWarn>
<EntryPointProjectUniqueName>..\BiliLite.UWP\BiliLite.UWP.csproj</EntryPointProjectUniqueName>
<PackageCertificateThumbprint>C4FA34A878A0528F84922932FEC6746BCBCA5CEA</PackageCertificateThumbprint>
<PackageCertificateThumbprint>FD3F8B8872537B6FE4A2319C0534D6A8AEE6D419</PackageCertificateThumbprint>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
Expand Down
22 changes: 18 additions & 4 deletions src/BiliLite.UWP/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Microsoft.Toolkit.Uwp.Helpers;
using System;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.ApplicationModel.Core;
Expand All @@ -18,7 +19,6 @@
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using BiliLite.Pages;
using BiliLite.ViewModels.Download;
using Microsoft.Extensions.DependencyInjection;

namespace BiliLite
Expand Down Expand Up @@ -205,12 +205,26 @@ private async void InitBili()
//圆角
App.Current.Resources["ImageCornerRadius"] = new CornerRadius(SettingService.GetValue<double>(SettingConstants.UI.IMAGE_CORNER_RADIUS, 0));
await AppHelper.SetRegions();
var downloadViewModel = ServiceProvider.GetRequiredService<DownloadPageViewModel>();
downloadViewModel.LoadDownloading();
downloadViewModel.LoadDownloaded();
await InitDb();
try
{
var downloadService = ServiceProvider.GetRequiredService<DownloadService>();
downloadService.LoadDownloading();
downloadService.LoadDownloaded();
}
catch (Exception ex)
{
logger.Error("初始化加载下载视频错误", ex);
}
VideoPlayHistoryHelper.LoadABPlayHistories(true);
}

private async Task InitDb()
{
var sqlMigrateService = ServiceProvider.GetRequiredService<SqlMigrateService>();
await sqlMigrateService.MigrateDatabase();
}

/// <summary>
/// 导航到特定页失败时调用
/// </summary>
Expand Down
28 changes: 28 additions & 0 deletions src/BiliLite.UWP/Assets/DbMigrations/01-0_40704.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-- 创建 DownloadedItems 表
CREATE TABLE IF NOT EXISTS DownloadedItems (
"ID" TEXT NOT NULL CONSTRAINT "PK_DownloadedItems" PRIMARY KEY,
"IsSeason" INTEGER NOT NULL,
"CoverPath" TEXT NULL,
"Title" TEXT NULL,
"UpdateTime" TEXT NOT NULL,
"Path" TEXT NULL
);

-- 创建 DownloadedSubItems 表
CREATE TABLE IF NOT EXISTS "DownloadedSubItems" (
"CID" TEXT NOT NULL CONSTRAINT "PK_DownloadedSubItems" PRIMARY KEY,
"EpisodeID" TEXT NULL,
"Title" TEXT NULL,
"IsDash" INTEGER NOT NULL,
"QualityID" INTEGER NOT NULL,
"QualityName" TEXT NULL,
"PathList" TEXT NULL,
"DanmakuPath" TEXT NULL,
"Index" INTEGER NOT NULL,
"FilePath" TEXT NULL,
"SubtitlePaths" TEXT NULL,
"DownloadedItemDTOID" TEXT NULL,
CONSTRAINT "FK_DownloadedSubItems_DownloadedItems_DownloadedItemDTOID" FOREIGN KEY ("DownloadedItemDTOID") REFERENCES "DownloadedItems" ("ID") ON DELETE RESTRICT
);

CREATE INDEX "IX_DownloadedSubItems_DownloadedItemDTOID" ON "DownloadedSubItems" ("DownloadedItemDTOID");
Binary file added src/BiliLite.UWP/Assets/Icon/icon_view_point.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/BiliLite.UWP/Assets/Text/bili-merge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## BiliLite 导出视频
此功能需要BiliLite版本4.4.0及以上

1. 打开BiliLite UWP -『下载』-『下载完成』选项卡

2. 右键或长按需要导出的视频,选择『导出视频』

![](ms-appx:///Assets/Text/img/3382929121.png)

如果是多集视频,可以点击『保存』图标按钮

![](ms-appx:///Assets/Text/img/1433952792.png)

3. 选择导出视频的保存位置,等待导出完成即可。
PS:首次使用需要解压FFmpeg,可能会耗时久一点。

![](ms-appx:///Assets/Text/img/2655001972.png)

### 其他工具

- [基于python的视频合并脚本 https://github.com/TPAXcc/biliuwp-lite.Mixer](https://github.com/TPAXcc/biliuwp-lite.Mixer)
Binary file added src/BiliLite.UWP/Assets/Text/img/1433952792.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/BiliLite.UWP/Assets/Text/img/2655001972.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/BiliLite.UWP/Assets/Text/img/3382929121.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions src/BiliLite.UWP/BiliLite.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,11 @@
<Compile Include="Models\Common\Comment\HotReply.cs" />
<Compile Include="Models\Common\Danmaku\BiliDanmakuItem.cs" />
<Compile Include="Models\Common\Dynamic\DynamicUgcSeasonCardModel.cs" />
<Compile Include="Models\Common\MarkdownViewerPagerParameter.cs" />
<Compile Include="Models\Common\Player\RealPlayerType.cs" />
<Compile Include="Models\Common\Player\PlaySpeedMenu.cs" />
<Compile Include="Models\Common\Season\EpisodeSkip.cs" />
<Compile Include="Models\Common\Player\PlayerSkipItem.cs" />
<Compile Include="Models\Common\Settings\FilterRule.cs" />
<Compile Include="Models\Common\Settings\FilterRuleTypes.cs" />
<Compile Include="Models\Common\UploadFileInfo.cs" />
Expand All @@ -222,6 +226,7 @@
<Compile Include="Models\Common\User\SendDynamic\UploadImagesModel.cs" />
<Compile Include="Models\Common\User\SendDynamic\RcmdTopicModel.cs" />
<Compile Include="Models\Common\Video\MediaListResources.cs" />
<Compile Include="Models\Databases\DownloadItemDTO.cs" />
<Compile Include="Models\Databases\SettingItem.cs" />
<Compile Include="Models\Functions\BaseShortcutFunction.cs" />
<Compile Include="Models\Functions\CancelFullscreenFunction.cs" />
Expand Down Expand Up @@ -258,7 +263,12 @@
<Compile Include="Models\Functions\ToggleFullWindowShortcutFunction.cs" />
<Compile Include="Models\Functions\ToggleMiniWindowShortcutFunction.cs" />
<Compile Include="Pages\IScrollRecorablePage.cs" />
<Compile Include="Pages\Other\MarkdownViewerPage.xaml.cs">
<DependentUpon>MarkdownViewerPage.xaml</DependentUpon>
</Compile>
<Compile Include="Services\BiliLiteDbContext.cs" />
<Compile Include="Services\DownloadService.cs" />
<Compile Include="Services\SqlMigrateService.cs" />
<Compile Include="ViewModels\Common\MainPageViewModel.cs" />
<Compile Include="ViewModels\Common\PieControlViewModel.cs" />
<Compile Include="ViewModels\Settings\CDNServerItemViewModel.cs" />
Expand Down Expand Up @@ -937,8 +947,10 @@
<Compile Include="ViewModels\Video\VideoListViewModel.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\DbMigrations\01-0_40704.sql" />
<Content Include="Assets\GeeTest\bili_gt.html" />
<Content Include="Assets\GeeTest\gt.js" />
<Content Include="Assets\Icon\icon_view_point.png" />
<Content Include="Assets\Icon\ic_play.png" />
<Content Include="Assets\Icon\icon_share.png" />
<Content Include="Assets\Icon\ic_live_center_gold_recharge.png" />
Expand Down Expand Up @@ -1040,6 +1052,9 @@
<Content Include="Assets\StoreLogo.scale-200.png" />
<Content Include="Assets\StoreLogo.scale-400.png" />
<Content Include="Assets\Text\help.md" />
<Content Include="Assets\Text\img\1433952792.png" />
<Content Include="Assets\Text\img\2655001972.png" />
<Content Include="Assets\Text\img\3382929121.png" />
<Content Include="Assets\Text\version_log.txt" />
<Content Include="Assets\Thumbnails\Placeholde.png" />
<Content Include="Assets\Thumbnails\Placeholde1x1.png" />
Expand All @@ -1052,6 +1067,7 @@
<Content Include="Assets\Fonts\FansNum.otf" />
<Content Include="Assets\Fonts\biliicon.ttf" />
<Content Include="Assets\GeeTest\bili_gt.cshtml" />
<Content Include="Assets\Text\bili-merge.md" />
<None Include="Assets\Text\new_version.json" />
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
Expand Down Expand Up @@ -1159,6 +1175,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Pages\Other\MarkdownViewerPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\User\CollectedPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
4 changes: 3 additions & 1 deletion src/BiliLite.UWP/Controls/Player.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ private MediaSourceConfig CreateFFmpegInteropConfig(string userAgent, string ref
if (referer != null && referer.Length > 0)
{
_ffmpegConfig.FFmpegOptions.Add("referer", referer);
_ffmpegConfig.FFmpegOptions.Add("headers", $"Referer: {referer}");
}

_ffmpegConfig.VideoDecoderMode = passthrough ? VideoDecoderMode.ForceSystemDecoder : VideoDecoderMode.ForceFFmpegSoftwareDecoder;
Expand Down Expand Up @@ -520,7 +521,7 @@ public async Task<PlayerOpenResult> PlayerDashUseNative(BiliDashPlayUrlInfo dash
message = "创建MediaSource失败"
};
}

m_playerVideo.Source = MediaSource.CreateFromAdaptiveMediaSource(mediaSource);
Buffering = true;

Expand Down Expand Up @@ -665,6 +666,7 @@ public async Task<PlayerOpenResult> PlayDashUseFFmpegInterop(BiliDashPlayUrlInfo
//关闭正在播放的视频
ClosePlay();
var _ffmpegConfig = CreateFFmpegInteropConfig(userAgent, referer);

if (isLocal)
{

Expand Down
63 changes: 54 additions & 9 deletions src/BiliLite.UWP/Controls/PlayerControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
xmlns:fa="using:FontAwesome5" xmlns:player="using:BiliLite.Modules.Player"
xmlns:common="using:BiliLite.Models.Common"
xmlns:player1="using:BiliLite.Models.Common.Player"
xmlns:modules="using:BiliLite.Modules"
d:DesignHeight="800"
d:DesignWidth="1000">
<UserControl.Resources>
Expand Down Expand Up @@ -302,7 +303,7 @@
<StackPanel>
<Grid Visibility="{Binding ShowTitlePart}">
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="25"></ColumnDefinition>
<ColumnDefinition MinWidth="25" Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding TitlePage}"
Expand Down Expand Up @@ -410,7 +411,7 @@
<TextBlock Margin="0 4 0 0">弹幕同屏密度(0为不限制) <Run Text="{x:Bind Path=DanmuSettingMaxNum.Value,Mode=OneWay,Converter={StaticResource numberToStringConvert}}"/></TextBlock>
<Slider x:Name="DanmuSettingMaxNum" Value="0" Minimum="0" Maximum="50" StepFrequency="1"></Slider>
<TextBlock Margin="0 4 0 0">
弹幕字体
弹幕字体
</TextBlock>
<AutoSuggestBox QueryIcon="Accept" x:Name="DanmuSettingFont"></AutoSuggestBox>

Expand Down Expand Up @@ -446,7 +447,7 @@
<TextBlock Foreground="White" >合并重复弹幕</TextBlock>
</ToggleSwitch.Header>
</ToggleSwitch>

</Grid>
<TextBlock Margin="0 8">屏蔽等级(0为不屏蔽) <Run Text="{x:Bind Path=DanmuSettingShieldLevel.Value,Mode=OneWay,Converter={StaticResource numberToStringConvert}}"/>级</TextBlock>
<Slider x:Name="DanmuSettingShieldLevel" Minimum="0" Maximum="10" StepFrequency="1"></Slider>
Expand Down Expand Up @@ -605,10 +606,10 @@
DoubleTapped="Grid_DoubleTapped">
<!--播放器-->
<local:Player x:Name="Player" PlayStateChanged="Player_PlayStateChanged" PlayMediaEnded="Player_PlayMediaEnded" PlayMediaError="Player_PlayMediaError" ChangeEngine="Player_ChangeEngine" PlayMediaOpened="Player_PlayMediaOpened"/>

<!--字幕-->
<Border x:Name="BorderSubtitle" Visibility="Collapsed" Opacity="{Binding ElementName=SubtitleSettingOpacity,Path=Value,Mode=OneWay}" Padding="3 4 8 4" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0 0 0 24">

</Border>
<!--弹幕-->
<Grid>
Expand Down Expand Up @@ -666,7 +667,7 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>

<Grid x:Name="VirtualProgressBar"
Visibility="{x:Bind m_viewModel.ShowVideoBottomVirtualProgressBar}">
<Grid.RowDefinitions>
Expand Down Expand Up @@ -702,9 +703,15 @@
<TextBlock x:Name="TopTitle" VerticalAlignment="Center" Foreground="White" FontSize="18" Margin="12 0" TextTrimming="CharacterEllipsis">第一集</TextBlock>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<TextBlock x:Name="TopOnline" Foreground="White" FontSize="16" VerticalAlignment="Center" Margin="12 0"></TextBlock>

<Button x:Name="TopBtnViewPoints"
Visibility="{x:Bind m_viewModel.ShowViewPointsBtn,Mode=OneWay}"
Click="TopBtnViewPoints_OnClick" Background="Transparent" Padding="0" Width="48" Height="48">
<Image Width="28" Height="28" Source="/Assets/Icon/icon_view_point.png" ></Image>
</Button>

<Button x:Name="TopBtnSettingDanmaku" Click="TopBtnSettingDanmaku_Click" Background="Transparent" Padding="0" Width="48" Height="48">
<Image Width="28" Height="28" Source="/Assets/Icon/icon_danmaku_setting.png" ></Image>

</Button>
<Button x:Name="TopBtnScreenshot" Click="TopBtnScreenshot_Click" Background="Transparent" Padding="0" Width="48" Height="48">
<Button.KeyboardAccelerators>
Expand Down Expand Up @@ -887,7 +894,7 @@
</StackPanel>
</Grid>
</Grid>

</Grid>
<Grid x:Name="MiniControl" Visibility="Collapsed" VerticalAlignment="Bottom">
<Grid.Background>
Expand Down Expand Up @@ -915,11 +922,49 @@
</StackPanel>
<ProgressBar VerticalAlignment="Bottom" Foreground="White" Value="{Binding ElementName=BottomProgress,Path=Value,Mode=OneWay}" Maximum="{Binding ElementName=BottomProgress,Path=Maximum,Mode=OneWay}"></ProgressBar>
</Grid>

</Grid>
<HyperlinkButton x:Name="BottomImageBtnPlay" Visibility="Collapsed" Margin="24 100" Width="80" Height="80" Click="BottomBtnPlay_Click" VerticalAlignment="Bottom" HorizontalAlignment="Right" >
<Image Source="ms-appx:///Assets/Icon/ic_play.png"></Image>
</HyperlinkButton>

<!--看点列表-->
<Grid x:Name="ViewPointsGrid"
Visibility="{x:Bind m_viewModel.ShowViewPointsView,Mode=OneWay}"
Tapped="ViewPointsGrid_OnTapped"
Background="Transparent">
<Grid
Width="320"
HorizontalAlignment="Right"
Background="#C8000000">
<ListView
SelectionMode="Single"
ItemsSource="{x:Bind m_viewModel.ViewPoints,Mode=OneWay}">
<ListView.ItemTemplate>
<DataTemplate x:DataType="modules:PlayerInfoViewPoint">
<ListViewItem>
<StackPanel Margin="0 8 0 8" Orientation="Horizontal" Tapped="ViewPoint_OnTapped"
Background="Transparent">
<Image Source="{x:Bind ImgUrl}" Width="120"></Image>
<StackPanel Orientation="Vertical"
Margin="8 0 0 0"
Width="172">
<TextBlock Text="{x:Bind Content}"
TextWrapping="Wrap"></TextBlock>
<TextBlock>
<Run Text="{x:Bind From,Converter={StaticResource progress}}"></Run>
-
<Run Text="{x:Bind To,Converter={StaticResource progress}}"></Run>
</TextBlock>
</StackPanel>
</StackPanel>
</ListViewItem>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</Grid>

<Button x:Name="BtnFoucs" Width="0" Height="0" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="-8 -8 0 0" Background="Transparent" BorderThickness="0"></Button>
</Grid>
</SplitView>
Expand Down
Loading

0 comments on commit 99c5a9d

Please sign in to comment.