Skip to content

Commit

Permalink
Merge pull request #564 from ywmoyue/dev
Browse files Browse the repository at this point in the history
4.6.29
  • Loading branch information
ywmoyue authored Apr 9, 2024
2 parents 148ea82 + 0ec337d commit 0c44cf7
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 35 deletions.
2 changes: 1 addition & 1 deletion document/new_version.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "4.6.28",
"version_num": 40628,
"version_desc": "更新内容:\r\n\r\n- 播放器音量偏低打开新视频时提示当前音量\r\n\r\n- 修复使用寒霜弹幕使时发送弹幕后报错\r\n\r\n- 修复使用寒霜弹幕使时更新弹幕会将当前时间段当前时间之前的所有弹幕全部显示\r\n\r\n- 修复仅1位作者的视频详情页不显示关注按钮\r\n\r\n- 修复用户空间查看动态报错鉴权失 败\r\n\r\n- 修复启用自动全屏后播放视频按空格暂停左上角会出现内部透明的白色实线方框\r\n\r\n\r\n\r\n\r\n 如果无法打开下载地址,请访问:https://github.com/ywmoyue/biliuwp-lite/releases",
"version_desc": "更新内容:\r\n\r\n- 首页Tab自定义支持添加稍后再看、历史记录、我的收藏\r\n\r\n- 展示评论下热门回复\r\n\r\n- 提高评论控件狭窄模式触发宽度,默认宽度时单行显示文字更多\r\n\r\n- 启动画面背景色跟随系统主题\r\n\r\n- 减少安装包体积\r\n\r\n- 修复首页推荐Tab中无法打开直播\r\n\r\n- 修复页面中输入框无法输入空格\r\n\r\n- 修复WebPage打开新页面错误\r\n\r\n- 修复用户主页空间动态打开失败,更换接口并重新适配数据\r\n\r\n- 修复动态详情打开失败\r\n\r\n- 修复首页搜索视频请求搜索建议报错\r\n\r\n\r\n\r\n\r\n 如果无法打开下载地址,请访问:https://github.com/ywmoyue/biliuwp-lite/releases",
"url": "https://github.com/ywmoyue/biliuwp-lite/releases",
"download_url": "https://github.com/ywmoyue/biliuwp-lite/releases"
}
64 changes: 33 additions & 31 deletions src/BiliLite.UWP/Controls/Dynamic/DynamicV2Template.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,47 +26,49 @@
<DataTemplate x:Key="DynamicAv">
<local:DynamicItemV2Control ViewModel="{Binding}">
<local:DynamicItemV2Control.CardContent>
<Button HorizontalAlignment="Stretch"
HorizontalContentAlignment="Left"
<Grid>
<Button HorizontalAlignment="Stretch"
HorizontalContentAlignment="Left"
Padding="0"
Background="Transparent"
Command="{Binding Path=Parent.LaunchUrlCommand}"
CommandParameter="{Binding Path=Dynamic.DynArchive.Uri}">
<Button.ContextFlyout>
<MenuFlyout>
<MenuFlyoutItem Icon="Add"
<Button.ContextFlyout>
<MenuFlyout>
<MenuFlyoutItem Icon="Add"
Text="添加到稍后再看"
Command="{Binding Path=Parent.WatchLaterCommand}"
CommandParameter="{Binding Path=Dynamic.DynArchive.Avid}"></MenuFlyoutItem>
</MenuFlyout>
</Button.ContextFlyout>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
</MenuFlyout>
</Button.ContextFlyout>
<Grid>
<Border CornerRadius="4">
<Image Source="{Binding Path=Dynamic.DynArchive.Cover}" Width="{Binding Path=CoverWidth}"></Image>
</Border>
<Border Background="#C8FF69B4" CornerRadius="2" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="4">
<TextBlock Margin="4 2" Foreground="White" FontSize="12" Text="视频"></TextBlock>
</Border>
<Border Background="#C8000000" CornerRadius="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="4">
<TextBlock Margin="4 2" Foreground="White" FontSize="12" Text="{Binding Path=Dynamic.DynArchive.CoverLeftText1}"></TextBlock>
</Border>
</Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid>
<Border CornerRadius="4">
<Image Source="{Binding Path=Dynamic.DynArchive.Cover}" Width="{Binding Path=CoverWidth}" MaxHeight="120"></Image>
</Border>
<Border Background="#C8FF69B4" CornerRadius="2" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="4">
<TextBlock Margin="4 2" Foreground="White" FontSize="12" Text="视频"></TextBlock>
</Border>
<Border Background="#C8000000" CornerRadius="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="4">
<TextBlock Margin="4 2" Foreground="White" FontSize="12" Text="{Binding Path=Dynamic.DynArchive.CoverLeftText1}"></TextBlock>
</Border>
</Grid>

<StackPanel HorizontalAlignment="Stretch" Grid.Column="1" Margin="8 4 8 0">
<TextBlock Text="{Binding Path=Dynamic.DynArchive.Title}" Foreground="{ThemeResource TextColor}" TextTrimming="CharacterEllipsis" MaxLines="2" TextWrapping="Wrap"></TextBlock>
<TextBlock Margin="0 8 0 0" FontSize="14" Foreground="Gray">
<StackPanel HorizontalAlignment="Stretch" Grid.Column="1" Margin="8 4 8 0">
<TextBlock Text="{Binding Path=Dynamic.DynArchive.Title}" Foreground="{ThemeResource TextColor}" TextTrimming="CharacterEllipsis" MaxLines="2" TextWrapping="Wrap"></TextBlock>
<TextBlock Margin="0 8 0 0" FontSize="14" Foreground="Gray">
<Run Text="{Binding Dynamic.DynArchive.CoverLeftText2}"></Run>
<Run Text=" "></Run>
<Run Text="{Binding Dynamic.DynArchive.CoverLeftText3}"></Run>
</TextBlock>
</StackPanel>
</Grid>
</Button>
</TextBlock>
</StackPanel>
</Grid>
</Button>
</Grid>
</local:DynamicItemV2Control.CardContent>
</local:DynamicItemV2Control>
</DataTemplate>
Expand Down Expand Up @@ -179,15 +181,15 @@
</Grid.ColumnDefinitions>
<Grid>
<Border CornerRadius="4">
<Image Source="{Binding Path=Dynamic.DynArticle.Covers[0]}" Width="{Binding Path=CoverWidth}"></Image>
<Image Source="{Binding Path=Extend.OrigImgUrl}" Width="{Binding Path=CoverWidth}"></Image>
</Border>
<Border Background="#C8FF69B4" CornerRadius="2" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="4">
<TextBlock Margin="4 2" Foreground="White" FontSize="12" Text="专栏"></TextBlock>
</Border>
</Grid>

<StackPanel HorizontalAlignment="Stretch" Grid.Column="1" Margin="8 4 8 0">
<TextBlock Text="{Binding Path=Dynamic.DynArticle.Title}" Foreground="{ThemeResource TextColor}" TextTrimming="CharacterEllipsis" MaxLines="2" TextWrapping="Wrap"></TextBlock>
<TextBlock Text="{Binding Path=Extend.OrigDesc[0].Text}" Foreground="{ThemeResource TextColor}" TextTrimming="CharacterEllipsis" MaxLines="2" TextWrapping="Wrap"></TextBlock>
</StackPanel>
</Grid>
</Button>
Expand Down
3 changes: 3 additions & 0 deletions src/BiliLite.UWP/Extensions/MapperExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ public static IServiceCollection AddMapper(this IServiceCollection services)
.ForMember(dest => dest.Desc,
opt => opt.MapFrom(src =>
src.Modules.FirstOrDefault(x => x.ModuleType == DynModuleType.ModuleDesc).ModuleDesc))
.ForMember(dest => dest.OpusSummary,
opt => opt.MapFrom(src =>
src.Modules.FirstOrDefault(x => x.ModuleType == DynModuleType.ModuleOpusSummary).ModuleOpusSummary))
.ForMember(dest => dest.Stat,
opt => opt.MapFrom(src =>
src.Modules.FirstOrDefault(x => x.ModuleType == DynModuleType.ModuleStat).ModuleStat));
Expand Down
26 changes: 23 additions & 3 deletions src/BiliLite.UWP/ViewModels/UserDynamic/DynamicV2ItemViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public ModuleDynamic Dynamic

public ModuleDesc Desc { get; set; }

public ModuleOpusSummary OpusSummary { get; set; }

public DynamicV2ItemViewModel Item { get; set; }

public List<DynamicV2ItemViewModel> Items
Expand Down Expand Up @@ -91,10 +93,9 @@ public ModuleStat Stat

public Extend Extend { get; set; }

[DependsOn(nameof(Content))]
public bool ShowContent => Desc != null;
[DependsOn(nameof(Content))] public bool ShowContent => Desc != null || OpusSummary != null;

[DependsOn(nameof(Desc))]
[DependsOn(nameof(Desc),nameof(OpusSummary))]
public RichTextBlock Content
{
get
Expand All @@ -109,6 +110,15 @@ public RichTextBlock Content
bindingCommands: nameof(Parent));
}

if (OpusSummary != null)
{
var text = OpusSummary.Summary.Text.Nodes.Aggregate("", (current, textNode) => current + textNode.RawText);
return
text.UserDynamicStringToRichText(
Extend.DynIdStr, wordNodes: Extend.OpusSummary?.Summary?.Text?.Nodes?.ToList(),
bindingCommands: nameof(Parent));
}

return new RichTextBlock();
}
catch (Exception ex)
Expand All @@ -120,6 +130,16 @@ public RichTextBlock Content

public int CoverWidth => 160;

[DependsOn(nameof(Dynamic))]
public bool IsShortVideo
{
get
{
if (Dynamic.DynArchive?.Dimension == null) return false;
return (Dynamic.DynArchive.Dimension.Height / Dynamic.DynArchive.Dimension.Width) > 1.5;
}
}

[DependsOn(nameof(AuthorForward),nameof(CardType),nameof(ItemType))]
public bool IsRepost => AuthorForward != null;

Expand Down

0 comments on commit 0c44cf7

Please sign in to comment.