Compare commits

...

38 Commits

Author SHA1 Message Date
real-zony
e08d1c7f16 ci: Publish new version.(4.0.2)
Some checks failed
.NET / build (push) Has been cancelled
.NET / release (push) Has been cancelled
2024-12-15 15:29:32 +08:00
real-zony
c3d98d60b5 fix: Fixed the garbled text issue caused by the CSV file encoding. (#156) 2024-12-15 15:20:33 +08:00
real-zony
8aac9e16a6 ci: Release new version.
Some checks failed
.NET / build (push) Has been cancelled
.NET / release (push) Has been cancelled
2024-11-29 23:20:04 +08:00
real-zony
21f25ee500 Merge remote-tracking branch 'origin/dev' into dev 2024-11-29 23:12:45 +08:00
real-zony
9a979942e3 test: Removed irrelevant tests. 2024-11-29 23:12:26 +08:00
real-zony
32b6c4052b build: Upgraded package version. 2024-11-29 23:11:40 +08:00
real-zony
7732ab52d3 refactor: Removed avalonia code. 2024-11-29 22:54:38 +08:00
Zony
1fdbaef7a8
Set English as the default language for project README. 2024-07-10 10:08:29 +08:00
Zony
36ef2d2c3a
Update English documentation. 2024-07-10 10:07:08 +08:00
Zony
fa4620c37d
Add separate Chinese documentation. 2024-07-10 10:00:57 +08:00
real-zony
9ab9cd50e2 feat: Mostly completed bidirectional binding for settings page and configuration. 2024-07-03 23:38:33 +08:00
real-zony
e66ef89e7a build: Upgrade the YamlDotNet version. 2024-07-02 21:51:55 +08:00
real-zony
8b5d5c64b0 refactor: Adjusted the structure of the configuration file.
BREAKING CHANGE: Adjusted the internal structure of the config.yaml file, removed the top-level hierarchy.
2024-07-02 21:22:40 +08:00
real-zony
2dca5239f5 fix: Fixed exception throw when NumericUpDown is empty. 2024-07-02 21:00:03 +08:00
real-zony
d5689164b5 fix(Fixed some issues in the settings page.): 2024-07-02 18:27:52 +08:00
real-zony
b57739f543 feat: Completed the adjustments and bindings of global settings. 2024-07-02 10:43:23 +08:00
real-zony
a2c44901fd refactor: Fixed incorrect naming. 2024-06-30 22:02:33 +08:00
real-zony
6ad2992144 feat: Added some UI animation effects. 2024-06-30 21:58:41 +08:00
real-zony
3b0c55ac00 feat: Completed the download lyrics feature. 2024-06-30 17:52:12 +08:00
real-zony
81bf6ebe3f refactor: Adjusted the view model to support reactive programming. 2024-06-30 17:51:53 +08:00
real-zony
aa3c45101b feat: Added a comparator for MusicInfo. 2024-06-30 17:50:49 +08:00
real-zony
d00d735bf0 feat: When downloading lyrics, a callback was added to facilitate UI updates. 2024-06-30 17:50:26 +08:00
real-zony
7fa595a71b refactor: Removed unused styles. 2024-06-28 15:13:00 +08:00
real-zony
4f15d06e63 feat: Added a settings page. 2024-06-28 15:07:06 +08:00
real-zony
5ccd8a7c53 feat: Complete the basic GUI layout. 2024-06-28 12:33:14 +08:00
real-zony
14812bceb7 refactor: Removed the local server project. 2024-06-28 12:29:31 +08:00
real-zony
be538eb650 feat: Upgraded the versions of the packages that the project depends on. 2024-06-28 12:27:24 +08:00
real-zony
888c7f511b refactor: Removed unused files. 2024-06-28 12:23:48 +08:00
Zony
7bd1915f11
Merge pull request #150 from w568w/patch-1
在 README 中添加 AUR 安装方式介绍
2024-06-19 17:37:47 +08:00
w568w
aa78ea0713
Update README.md 2024-06-08 07:16:29 +00:00
real-zony
1342ca936c build: Upgrade dependency packages. 2024-06-03 00:41:47 +08:00
Zony
46ac2d57a2
Merge pull request #149 from ZaneYork/dev
修复网易云歌曲ID溢出问题
2024-05-31 16:20:48 +08:00
ZaneYork
444f4e75a6 修复网易云歌曲ID溢出问题 2024-05-21 17:41:40 +08:00
Zony
61aa31cc6f
Removed alipay and wechatpay QR code image. 2024-04-12 16:09:06 +08:00
Zony
46d11a86ea
Update README.md 2024-04-12 16:08:19 +08:00
Zony
8aaae90ed8
Upgraded MusicDecrypto.Library version to 2.4.0. 2024-04-12 15:34:38 +08:00
real-zony
d91cc68a60 Merge remote-tracking branch 'origin/dev' into dev 2023-12-22 15:06:32 +08:00
real-zony
b6e3cb6038 chore: Upgrade version. 2023-12-22 14:59:48 +08:00
56 changed files with 318 additions and 640 deletions

View File

@ -20,7 +20,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Publish

11
Directory.Build.props Normal file
View File

@ -0,0 +1,11 @@
<Project>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>4.0.2</Version>
<Authors>Zony(real-zony)</Authors>
<RepositoryUrl>https://github.com/real-zony/ZonyLrcToolsX</RepositoryUrl>
</PropertyGroup>
</Project>

View File

@ -2,45 +2,44 @@
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="McMaster.Extensions.CommandLineUtils" Version="4.1.0"/>
<PackageVersion Include="McMaster.Extensions.Hosting.CommandLine" Version="4.1.0"/>
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0"/>
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0"/>
<PackageVersion Include="QRCoder" Version="1.4.3"/>
<PackageVersion Include="Serilog.Extensions.Hosting" Version="8.0.0"/>
<PackageVersion Include="Serilog.Sinks.Async" Version="1.5.0"/>
<PackageVersion Include="Serilog.Sinks.Console" Version="4.1.0"/>
<PackageVersion Include="Serilog.Sinks.File" Version="5.0.0"/>
<PackageVersion Include="System.Text.Encoding.CodePages" Version="8.0.0"/>
<PackageVersion Include="Polly" Version="8.2.0"/>
<PackageVersion Include="TagLibSharp" Version="2.3.0"/>
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3"/>
<PackageVersion Include="NetEscapades.Configuration.Yaml" Version="3.1.0"/>
<PackageVersion Include="MusicDecrypto.Library" Version="2.3.0"/>
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0"/>
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0"/>
<PackageVersion Include="AutoMapper" Version="12.0.1"/>
<PackageVersion Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1"/>
<PackageVersion Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="8.0.0"/>
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.0"/>
<PackageVersion Include="SuperSocket.WebSocket" Version="2.0.0-beta.11"/>
<PackageVersion Include="SuperSocket.WebSocket.Server" Version="2.0.0-beta.11"/>
<PackageVersion Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<PackageVersion Include="McMaster.Extensions.Hosting.CommandLine" Version="4.1.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="QRCoder" Version="1.6.0" />
<PackageVersion Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Serilog.Sinks.Async" Version="2.1.0" />
<PackageVersion Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageVersion Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageVersion Include="System.Text.Encoding.CodePages" Version="8.0.0" />
<PackageVersion Include="Polly" Version="8.5.0" />
<PackageVersion Include="TagLibSharp" Version="2.3.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NetEscapades.Configuration.Yaml" Version="3.1.0" />
<PackageVersion Include="MusicDecrypto.Library" Version="2.4.1" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageVersion Include="AutoMapper" Version="13.0.1" />
<PackageVersion Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
<PackageVersion Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="8.0.6" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.6" />
<PackageVersion Include="SuperSocket.WebSocket" Version="2.0.0-beta.11" />
<PackageVersion Include="SuperSocket.WebSocket.Server" Version="2.0.0-beta.11" />
<!-- Testing Projects -->
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
<PackageVersion Include="Shouldly" Version="4.2.1"/>
<PackageVersion Include="xunit" Version="2.6.3"/>
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.5"/>
<PackageVersion Include="coverlet.collector" Version="6.0.0"/>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="Shouldly" Version="4.2.1" />
<PackageVersion Include="xunit" Version="2.8.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<!-- Avalonia -->
<PackageVersion Include="Avalonia" Version="11.0.6"/>
<PackageVersion Include="Avalonia.Desktop" Version="11.0.6"/>
<PackageVersion Include="Avalonia.Themes.Fluent" Version="11.0.6"/>
<PackageVersion Include="Avalonia.Fonts.Inter" Version="11.0.6"/>
<PackageVersion Include="Avalonia.ReactiveUI" Version="11.0.6"/>
<PackageVersion Include="Avalonia.Diagnostics" Version="11.0.6"/>
<PackageVersion Include="Ude.NetStandard" Version="1.2.0" />
<PackageVersion Include="YamlDotNet" Version="16.2.0" />
</ItemGroup>
</Project>

View File

@ -1,29 +1,38 @@
简体中文 | [English](./docs/en_US.md)
English | [简体中文](./zh_CN.md)
# 免责声明
# Disclaimer
- 本工具仅作个人学习研究使用,可运行的二进制文件仅用于演示功能,不得将源码及其产物用于商业用途,否则由此造成的相关法律问题,[本人](https://github.com/real-zony) 不承担任何法律责任。
- 任何单位或个人因下载使用软件所产生的任何意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、附带或衍生的损失等)[本人](https://github.com/real-zony) 不承担任何法律责任。
- 用户明确并同意本声明条款列举的全部内容,对使用本工具可能存在的风险和相关后果将完全由用户自行承担,[本人](https://github.com/real-zony) 不承担任何法律责任。
- This tool is for personal learning and research purposes only. The executable binary files are for demonstration purposes only and the source code and its products must not be used for commercial purposes. Otherwise, I [here](https://github.com/real-zony) will not be responsible for any related legal issues.
- Any unit or individual that downloads and uses the software resulting in any accidents, negligence, contract breaches, defamation, copyright or intellectual property infringement, and their resulting losses (including but not limited to direct, indirect, incidental or derivative losses), I [here](https://github.com/real-zony) will not bear any legal responsibility.
- Users clearly agree to all the terms listed in this statement and fully assume the risks and consequences of using this tool. I [here](https://github.com/real-zony) will not bear any legal responsibility.
# 简介
# Introduction
ZonyLrcToolX 4 是一个基于 CEF 的跨平台歌词下载工具,**QQ 群:337656932**,群文件里面有详细的视频教程。
ZonyLrcToolX 4 is a cross-platform lyrics download tool based on CEF. **QQ Group: 337656932**. Detailed video tutorials are available in the group files.
🚧 当前版本正在开发当中。
🚧 如果你想查看可以工作的代码,请切换到 dev 分支。
🚧 The current version is under development.
🚧 If you want to see working code, please switch to the dev branch.
# 下载
# Download
如果你要获取最新版本,请访问 **[Release](https://github.com/real-zony/ZonyLrcToolsX/releases)** 页面进行下载。
To get the latest version, please visit the **[Release](https://github.com/real-zony/ZonyLrcToolsX/releases)** page for download.
# 用法
## Arch Linux User Repository
软件的具体使用方法已经迁移到了全新的文档站点,请跳转到 [https://docs.myzony.com](https://docs.myzony.com),里面包含完整的说明文档。
This software has been packaged into [AUR](https://aur.archlinux.org/packages/zonylrctoolsx-bin). Arch Linux and its derivative distribution users can install it with the following command:
# 捐赠
```bash
# yay or other AUR Helpers
yay -S zonylrctoolsx-bin
<img src="./docs/img/alipay.jpg" width="200"/><img src="./docs/img/wechat.jpg" width="200"/>
ZonyLrcTools.Cli --help
```
# Usage
Detailed usage instructions have been moved to a new documentation site. Please visit [https://docs.myzony.com](https://docs.myzony.com) for complete documentation.
# Donation
[爱发电](https://afdian.net/a/zony-lrc-tools)
# Star History

View File

@ -11,12 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZonyLrcTools.Cli", "src\Zon
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZonyLrcTools.Tests", "tests\ZonyLrcTools.Tests\ZonyLrcTools.Tests.csproj", "{FFBD3200-568F-455B-8390-5E76C51D522C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZonyLrcTools.LocalServer", "src\ZonyLrcTools.LocalServer\ZonyLrcTools.LocalServer.csproj", "{2875A08A-FFD6-4863-B815-5384DCFE88FC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZonyLrcTools.Common", "src\ZonyLrcTools.Common\ZonyLrcTools.Common.csproj", "{9B42E4CA-61AA-4798-8D2B-2D8A7035EB67}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZonyLrcTools.Desktop", "src\ZonyLrcTools.Desktop\ZonyLrcTools.Desktop.csproj", "{DC92902B-4303-4E43-AFB3-3F93FD3986AD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -31,18 +27,10 @@ Global
{FFBD3200-568F-455B-8390-5E76C51D522C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FFBD3200-568F-455B-8390-5E76C51D522C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FFBD3200-568F-455B-8390-5E76C51D522C}.Release|Any CPU.Build.0 = Release|Any CPU
{2875A08A-FFD6-4863-B815-5384DCFE88FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2875A08A-FFD6-4863-B815-5384DCFE88FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2875A08A-FFD6-4863-B815-5384DCFE88FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2875A08A-FFD6-4863-B815-5384DCFE88FC}.Release|Any CPU.Build.0 = Release|Any CPU
{9B42E4CA-61AA-4798-8D2B-2D8A7035EB67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9B42E4CA-61AA-4798-8D2B-2D8A7035EB67}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9B42E4CA-61AA-4798-8D2B-2D8A7035EB67}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9B42E4CA-61AA-4798-8D2B-2D8A7035EB67}.Release|Any CPU.Build.0 = Release|Any CPU
{DC92902B-4303-4E43-AFB3-3F93FD3986AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC92902B-4303-4E43-AFB3-3F93FD3986AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC92902B-4303-4E43-AFB3-3F93FD3986AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC92902B-4303-4E43-AFB3-3F93FD3986AD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -53,8 +41,6 @@ Global
GlobalSection(NestedProjects) = preSolution
{55D74323-ABFA-4A73-A3BF-F3E8D5DE6DE8} = {C29FB05C-54B1-4020-94D2-87E192EB2F98}
{FFBD3200-568F-455B-8390-5E76C51D522C} = {AF8ADB2F-E46C-4DEE-8316-652D9FE1A69B}
{2875A08A-FFD6-4863-B815-5384DCFE88FC} = {C29FB05C-54B1-4020-94D2-87E192EB2F98}
{9B42E4CA-61AA-4798-8D2B-2D8A7035EB67} = {C29FB05C-54B1-4020-94D2-87E192EB2F98}
{DC92902B-4303-4E43-AFB3-3F93FD3986AD} = {C29FB05C-54B1-4020-94D2-87E192EB2F98}
EndGlobalSection
EndGlobal

View File

@ -1,18 +1,39 @@
English | [简体中文](./zh_CN.md)
## Overview
# Disclaimer
ZonyLrcToolX 2.0 is a cross-platform lyric downlaod tool based on CEF.
- This tool is for personal learning and research purposes only. The executable binary files are for demonstration purposes only and the source code and its products must not be used for commercial purposes. Otherwise, I [here](https://github.com/real-zony) will not be responsible for any related legal issues.
- Any unit or individual that downloads and uses the software resulting in any accidents, negligence, contract breaches, defamation, copyright or intellectual property infringement, and their resulting losses (including but not limited to direct, indirect, incidental or derivative losses), I [here](https://github.com/real-zony) will not bear any legal responsibility.
- Users clearly agree to all the terms listed in this statement and fully assume the risks and consequences of using this tool. I [here](https://github.com/real-zony) will not bear any legal responsibility.
# Introduction
ZonyLrcToolX 4 is a cross-platform lyrics download tool based on CEF. **QQ Group: 337656932**. Detailed video tutorials are available in the group files.
🚧 The current version is under development.
🚧 If you want to see the working code, please switch to the 1.0 branch.
🚧 If you want to see working code, please switch to the dev branch.
## Usage
# Download
## Donation
To get the latest version, please visit the **[Release](https://github.com/real-zony/ZonyLrcToolsX/releases)** page for download.
## Roadmap
## Arch Linux User Repository
- [ ] Supports cross-platform CLI tools.
- [ ] Web GUI based site (local).
- [ ] Support plug-in system (Lua Engine).
This software has been packaged into [AUR](https://aur.archlinux.org/packages/zonylrctoolsx-bin). Arch Linux and its derivative distribution users can install it with the following command:
```bash
# yay or other AUR Helpers
yay -S zonylrctoolsx-bin
ZonyLrcTools.Cli --help
```
# Usage
Detailed usage instructions have been moved to a new documentation site. Please visit [https://docs.myzony.com](https://docs.myzony.com) for complete documentation.
# Donation
[爱发电](https://afdian.net/a/zony-lrc-tools)
# Star History
[![Star History Chart](https://api.star-history.com/svg?repos=real-zony/ZonyLrcToolsX&type=Timeline)](https://star-history.com/#real-zony/ZonyLrcToolsX&Timeline)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 247 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 KiB

40
docs/zh_CN.md Normal file
View File

@ -0,0 +1,40 @@
简体中文 | [English](./docs/en_US.md)
# 免责声明
- 本工具仅作个人学习研究使用,可运行的二进制文件仅用于演示功能,不得将源码及其产物用于商业用途,否则由此造成的相关法律问题,[本人](https://github.com/real-zony) 不承担任何法律责任。
- 任何单位或个人因下载使用软件所产生的任何意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、附带或衍生的损失等)[本人](https://github.com/real-zony) 不承担任何法律责任。
- 用户明确并同意本声明条款列举的全部内容,对使用本工具可能存在的风险和相关后果将完全由用户自行承担,[本人](https://github.com/real-zony) 不承担任何法律责任。
# 简介
ZonyLrcToolX 4 是一个基于 CEF 的跨平台歌词下载工具,**QQ 群:337656932**,群文件里面有详细的视频教程。
🚧 当前版本正在开发当中。
🚧 如果你想查看可以工作的代码,请切换到 dev 分支。
# 下载
如果你要获取最新版本,请访问 **[Release](https://github.com/real-zony/ZonyLrcToolsX/releases)** 页面进行下载。
## Arch Linux 用户仓库
本软件已打包到 [AUR](https://aur.archlinux.org/packages/zonylrctoolsx-bin)。Arch Linux 及其衍生发行版用户可用如下命令安装:
```bash
# yay 或其他 AUR Helper
yay -S zonylrctoolsx-bin
ZonyLrcTools.Cli --help
```
# 用法
软件的具体使用方法已经迁移到了全新的文档站点,请跳转到 [https://docs.myzony.com](https://docs.myzony.com),里面包含完整的说明文档。
# 捐赠
[爱发电](https://afdian.net/a/zony-lrc-tools)
# Star History
[![Star History Chart](https://api.star-history.com/svg?repos=real-zony/ZonyLrcToolsX&type=Timeline)](https://star-history.com/#real-zony/ZonyLrcToolsX&Timeline)

View File

@ -81,8 +81,7 @@ namespace ZonyLrcTools.Cli
.ConfigureLogging(l => l.AddSerilog())
.ConfigureHostConfiguration(builder =>
{
builder
.SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
builder.SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
.AddYamlFile("config.yaml");
})
.ConfigureServices((_, services) =>

View File

@ -3,10 +3,6 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
<AssemblyVersion>0.0.0.1</AssemblyVersion>
<FileVersion>0.0.0.1</FileVersion>
<PackageVersion>0.0.0.1</PackageVersion>
<Version>0.0.0.1</Version>
</PropertyGroup>
<ItemGroup>
@ -18,6 +14,7 @@
<PackageReference Include="Serilog.Sinks.Console"/>
<PackageReference Include="Serilog.Sinks.File"/>
<PackageReference Include="System.Text.Encoding.CodePages"/>
<PackageReference Include="Ude.NetStandard"/>
</ItemGroup>
<ItemGroup>

View File

@ -1,21 +1,21 @@
globalOption:
# 允许扫描的歌曲文件后缀名。
supportFileExtensions:
# 允许扫描的歌曲文件后缀名。
supportFileExtensions:
- '*.mp3'
- '*.flac'
- '*.wav'
- '*.m4a'
- '*.ogg'
- '*.opus'
# 网络代理服务设置,仅支持 HTTP 代理。
networkOptions:
# 网络代理服务设置,仅支持 HTTP 代理。
networkOptions:
isEnable: false # 是否启用代理。
ip: 127.0.0.1 # 代理服务 IP 地址。
port: 4780 # 代理服务端口号。
updateUrl: https://api.myzony.com/lrc-tools/update # 更新检查地址。
# 下载器的相关参数配置。
provider:
# 下载器的相关参数配置。
provider:
# 标签扫描器的相关参数配置。
tag:
# 支持的标签扫描器。

View File

@ -16,5 +16,10 @@
/// 搜索深度,值越大搜索结果越多,但搜索时间越长。
/// </summary>
public int Depth { get; set; }
/// <summary>
/// 歌词下载器的扩展属性。
/// </summary>
public Dictionary<string, string>? Additional { get; set; }
}
}

View File

@ -19,5 +19,10 @@ namespace ZonyLrcTools.Common.Configuration
/// 代理服务器的 端口。
/// </summary>
public int Port { get; set; }
/// <summary>
/// 更新检查的 Url。
/// </summary>
public string UpdateUrl { get; set; } = default!;
}
}

View File

@ -8,4 +8,9 @@ public class TagInfoOptions
/// 屏蔽词功能相关配置。
/// </summary>
public BlockWordOptions BlockWord { get; set; } = null!;
public TagInfoProviderOptions GetTagProviderOption(string name)
{
return Plugin.FirstOrDefault(x => x.Name == name)!;
}
}

View File

@ -6,6 +6,6 @@ namespace ZonyLrcTools.Common.Configuration
public int Priority { get; set; }
public Dictionary<string, string> Extensions { get; set; } = null!;
public Dictionary<string, string>? Extensions { get; set; } = null!;
}
}

View File

@ -47,7 +47,7 @@ namespace ZonyLrcTools.Common.Infrastructure.DependencyInject
.AddYamlFile("config.yaml")
.Build();
services.Configure<GlobalOptions>(configuration.GetSection("globalOption"));
services.Configure<GlobalOptions>(configuration);
return services;
}

View File

@ -10,9 +10,11 @@ public interface ILyricsDownloader
/// </summary>
/// <param name="needDownloadMusicInfos">需要下载的歌词信息。</param>
/// <param name="parallelCount">下载线程/并发量。</param>
/// <param name="callback">任务完成之后的回调方法。</param>
/// <param name="cancellationToken">任务取消标记。</param>
Task DownloadAsync(List<MusicInfo> needDownloadMusicInfos,
int parallelCount = 2,
int parallelCount = 1,
Func<MusicInfo, Task>? callback = null,
CancellationToken cancellationToken = default);
/// <summary>

View File

@ -10,6 +10,7 @@ using ZonyLrcTools.Common.Infrastructure.Threading;
namespace ZonyLrcTools.Common.Lyrics;
/// <inheritdoc cref="ZonyLrcTools.Common.Lyrics.ILyricsDownloader" />
public class LyricsDownloader : ILyricsDownloader, ISingletonDependency
{
private readonly IEnumerable<ILyricsProvider> _lyricsProviders;
@ -38,6 +39,7 @@ public class LyricsDownloader : ILyricsDownloader, ISingletonDependency
public async Task DownloadAsync(List<MusicInfo> needDownloadMusicInfos,
int parallelCount = 1,
Func<MusicInfo, Task>? callback = null,
CancellationToken cancellationToken = default)
{
await _logger.InfoAsync("开始下载歌词文件数据...");
@ -57,12 +59,12 @@ public class LyricsDownloader : ILyricsDownloader, ISingletonDependency
{
await DownloadAndWriteLyricsAsync(lyricsProvider, info);
if (info.IsSuccessful)
{
if (!info.IsSuccessful) continue;
_logger.LogSuccessful(info);
return;
}
break;
}
if (callback != null) await callback(info);
}, cancellationToken), cancellationToken));
await Task.WhenAll(downloadTasks);

View File

@ -8,7 +8,7 @@ using ZonyLrcTools.Common.Lyrics.Providers.KuGou.JsonModel;
namespace ZonyLrcTools.Common.Lyrics.Providers.KuGou
{
public class KuGourLyricsProvider : LyricsProvider
public class KuGouLyricsProvider : LyricsProvider
{
public override string DownloaderName => InternalLyricsProviderNames.KuGou;
@ -20,7 +20,7 @@ namespace ZonyLrcTools.Common.Lyrics.Providers.KuGou
private const string KuGouGetLyricAccessKeyUrl = @"http://lyrics.kugou.com/search";
private const string KuGouGetLyricUrl = @"http://lyrics.kugou.com/download";
public KuGourLyricsProvider(IWarpHttpClient warpHttpClient,
public KuGouLyricsProvider(IWarpHttpClient warpHttpClient,
ILyricsItemCollectionFactory lyricsItemCollectionFactory,
IOptions<GlobalOptions> options)
{

View File

@ -4,13 +4,13 @@ namespace ZonyLrcTools.Common.Lyrics.Providers.NetEase.JsonModel
{
public class GetSongDetailsRequest
{
public GetSongDetailsRequest(int songId)
public GetSongDetailsRequest(long songId)
{
SongId = songId;
SongIds = $"%5B{songId}%5D";
}
[JsonProperty("id")] public int SongId { get; }
[JsonProperty("id")] public long SongId { get; }
[JsonProperty("ids")] public string SongIds { get; }
}

View File

@ -8,7 +8,7 @@ namespace ZonyLrcTools.Common.Lyrics.Providers.NetEase.JsonModel
[JsonProperty("code")] public int StatusCode { get; set; }
public int GetFirstMatchSongId(string songName, long? duration)
public long GetFirstMatchSongId(string songName, long? duration)
{
var perfectMatch = Items.SongItems.FirstOrDefault(x => x.Name == songName);
if (perfectMatch != null)
@ -44,7 +44,7 @@ namespace ZonyLrcTools.Common.Lyrics.Providers.NetEase.JsonModel
/// 歌曲的 Sid (Song Id)。
/// </summary>
[JsonProperty("id")]
public int Id { get; set; }
public long Id { get; set; }
/// <summary>
/// 歌曲的演唱者。

View File

@ -57,5 +57,25 @@ namespace ZonyLrcTools.Common
[GeneratedRegex(@"[<>:""/\\|?*]")]
private static partial Regex InvalidFilePathRegex();
public static bool operator ==(MusicInfo? left, MusicInfo? right)
{
if (left is null && right is null)
{
return true;
}
if (left is null || right is null)
{
return false;
}
return left.FilePath == right.FilePath;
}
public static bool operator !=(MusicInfo? left, MusicInfo? right)
{
return !(left == right);
}
}
}

View File

@ -1,3 +1,5 @@
using System.Text;
using Ude;
using ZonyLrcTools.Common.Infrastructure.DependencyInject;
namespace ZonyLrcTools.Common.MusicScanner;
@ -13,11 +15,15 @@ public class CsvFileMusicScanner : ITransientDependency
/// <param name="csvFilePath">CSV 文件的路径。</param>
/// <param name="outputDirectory">歌词文件的输出目录。</param>
/// <param name="pattern">输出的歌词文件格式,默认是 "{Artist} - {Title}.lrc" 的形式。</param>
public async Task<List<MusicInfo>> GetMusicInfoFromCsvFileAsync(string csvFilePath, string outputDirectory, string pattern)
public async Task<List<MusicInfo>> GetMusicInfoFromCsvFileAsync(string csvFilePath, string outputDirectory,
string pattern)
{
var csvFileContent = await File.ReadAllTextAsync(csvFilePath);
var csvFileLines = csvFileContent.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
return csvFileLines.Skip(1).Select(line => GetMusicInfoFromCsvFileLine(line, outputDirectory, pattern)).ToList();
var encoding = DetectFileEncoding(csvFilePath);
var csvFileContent = await File.ReadAllTextAsync(csvFilePath, encoding);
var csvFileLines = csvFileContent.Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries);
return csvFileLines.Skip(1).Select(line => GetMusicInfoFromCsvFileLine(line, outputDirectory, pattern))
.ToList();
}
private MusicInfo GetMusicInfoFromCsvFileLine(string csvFileLine, string outputDirectory, string pattern)
@ -29,4 +35,19 @@ public class CsvFileMusicScanner : ITransientDependency
var musicInfo = new MusicInfo(fakeFilePath, name, artist);
return musicInfo;
}
private Encoding DetectFileEncoding(string filePath)
{
using var fileStream = File.OpenRead(filePath);
var detector = new CharsetDetector();
detector.Feed(fileStream);
detector.DataEnd();
if (detector.Charset != null)
{
return Encoding.GetEncoding(detector.Charset);
}
return Encoding.Default;
}
}

View File

@ -1,5 +0,0 @@
// namespace ZonyLrcTools.Common.MusicScanner;
//
// public class QQMusicSongListMusicScanner : IMusicScanner
// {
// }

View File

@ -4,7 +4,6 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>4.0.0.57</Version>
</PropertyGroup>
<ItemGroup>
@ -16,6 +15,8 @@
<PackageReference Include="Polly"/>
<PackageReference Include="QRCoder"/>
<PackageReference Include="TagLibSharp"/>
<PackageReference Include="Ude.NetStandard" />
<PackageReference Include="YamlDotNet" />
</ItemGroup>
<ItemGroup>

View File

@ -1,15 +0,0 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="ZonyLrcTools.Desktop.App"
xmlns:local="using:ZonyLrcTools.Desktop"
RequestedThemeVariant="Default">
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
<Application.DataTemplates>
<local:ViewLocator/>
</Application.DataTemplates>
<Application.Styles>
<FluentTheme />
</Application.Styles>
</Application>

View File

@ -1,28 +0,0 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using ZonyLrcTools.Desktop.ViewModels;
using ZonyLrcTools.Desktop.Views;
namespace ZonyLrcTools.Desktop;
public partial class App : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}
public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow = new MainWindow
{
DataContext = new MainWindowViewModel(),
};
}
base.OnFrameworkInitializationCompleted();
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

View File

@ -1,23 +0,0 @@
using Avalonia;
using Avalonia.ReactiveUI;
using System;
namespace ZonyLrcTools.Desktop;
class Program
{
// Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
[STAThread]
public static void Main(string[] args) => BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);
// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithInterFont()
.LogToTrace()
.UseReactiveUI();
}

View File

@ -1,27 +0,0 @@
using System;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
using ZonyLrcTools.Desktop.ViewModels;
namespace ZonyLrcTools.Desktop;
public class ViewLocator : IDataTemplate
{
public Control Build(object data)
{
var name = data.GetType().FullName!.Replace("ViewModel", "View");
var type = Type.GetType(name);
if (type != null)
{
return (Control)Activator.CreateInstance(type)!;
}
return new TextBlock { Text = "Not Found: " + name };
}
public bool Match(object data)
{
return data is ViewModelBase;
}
}

View File

@ -1,6 +0,0 @@
namespace ZonyLrcTools.Desktop.ViewModels;
public class MainWindowViewModel : ViewModelBase
{
public string Greeting => "Welcome to Avalonia!";
}

View File

@ -1,7 +0,0 @@
using ReactiveUI;
namespace ZonyLrcTools.Desktop.ViewModels;
public class ViewModelBase : ReactiveObject
{
}

View File

@ -1,20 +0,0 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:ZonyLrcTools.Desktop.ViewModels"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="ZonyLrcTools.Desktop.Views.MainWindow"
x:DataType="vm:MainWindowViewModel"
Icon="/Assets/avalonia-logo.ico"
Title="ZonyLrcTools.Desktop">
<Design.DataContext>
<!-- This only sets the DataContext for the previewer in an IDE,
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
<vm:MainWindowViewModel/>
</Design.DataContext>
<TextBlock Text="{Binding Greeting}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Window>

View File

@ -1,11 +0,0 @@
using Avalonia.Controls;
namespace ZonyLrcTools.Desktop.Views;
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}

View File

@ -1,25 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
</PropertyGroup>
<ItemGroup>
<Folder Include="Models\"/>
<AvaloniaResource Include="Assets\**"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia"/>
<PackageReference Include="Avalonia.Desktop"/>
<PackageReference Include="Avalonia.Themes.Fluent"/>
<PackageReference Include="Avalonia.Fonts.Inter"/>
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics"/>
<PackageReference Include="Avalonia.ReactiveUI"/>
</ItemGroup>
</Project>

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<!-- This manifest is used on Windows only.
Don't remove it as it might cause problems with window transparency and embeded controls.
For more details visit https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests -->
<assemblyIdentity version="1.0.0.0" name="ZonyLrcTools.Desktop.Desktop"/>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
</assembly>

View File

@ -1,7 +0,0 @@
namespace ZonyLrcTools.LocalServer.Contract.Dtos;
public class PagedListRequestDto
{
public int PageIndex { get; set; }
public int PageSize { get; set; }
}

View File

@ -1,9 +0,0 @@
namespace ZonyLrcTools.LocalServer.Contract.Dtos;
public class PagedListResultDto<T>
{
public int TotalCount { get; set; }
public int PageIndex { get; set; }
public int PageSize { get; set; }
public List<T> Items { get; set; } = new List<T>();
}

View File

@ -1,24 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using ZonyLrcTools.Common.Infrastructure.DependencyInject;
using ZonyLrcTools.LocalServer.Contract.Dtos;
using ZonyLrcTools.LocalServer.Services.MusicInfo;
using ZonyLrcTools.LocalServer.Services.MusicInfo.Dtos;
namespace ZonyLrcTools.LocalServer.Controllers;
[Route("api/music-infos")]
public class MusicInfoController : Controller, IMusicInfoService, ITransientDependency
{
private readonly IMusicInfoService _musicInfoService;
public MusicInfoController(IMusicInfoService musicInfoService)
{
_musicInfoService = musicInfoService;
}
[HttpGet]
public Task<PagedListResultDto<MusicInfoListItemDto>> GetMusicInfoListAsync(MusicInfoListInput input)
{
return _musicInfoService.GetMusicInfoListAsync(input);
}
}

View File

@ -1,15 +0,0 @@
using SuperSocket.WebSocket.Server;
namespace ZonyLrcTools.LocalServer.EventBus;
public class SuperSocketListener
{
public async Task ListenAsync()
{
var host = WebSocketHostBuilder.Create()
.UseWebSocketMessageHandler(async (session, message) => { await session.SendAsync(message); })
.Build();
await host.StartAsync();
}
}

View File

@ -1,66 +0,0 @@
using System.Diagnostics;
using System.Reflection;
using ZonyLrcTools.Common.Infrastructure.DependencyInject;
using ZonyLrcTools.LocalServer.EventBus;
#region Main Flow
var app = RegisterAndConfigureServices();
await ListenServices();
#endregion
#region Configure Services
async Task ListenServices()
{
await new SuperSocketListener().ListenAsync();
await app?.RunAsync()!;
}
WebApplication? RegisterAndConfigureServices()
{
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.ConfigureKestrel(k => k.ListenAnyIP(50002));
builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.BeginAutoDependencyInject<Program>();
var insideApp = builder.Build();
insideApp.UseSpaStaticFiles(new StaticFileOptions
{
RequestPath = "",
FileProvider = new Microsoft.Extensions.FileProviders
.ManifestEmbeddedFileProvider(
Assembly.GetExecutingAssembly(), "UiStaticResources"
)
});
insideApp.MapControllers();
#if !DEBUG
insideApp.Lifetime.ApplicationStarted.Register(OpenBrowser);
#endif
return insideApp;
}
void OpenBrowser()
{
const string url = "http://localhost:50002/index.html";
if (OperatingSystem.IsWindows())
{
Process.Start("explorer.exe", url);
}
else if (OperatingSystem.IsMacOS())
{
Process.Start("open", url);
}
else if (OperatingSystem.IsLinux())
{
Process.Start("xdg-open", url);
}
}
#endregion

View File

@ -1,14 +0,0 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"ZonyLrcTools.LocalServer": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:50002",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@ -1,16 +0,0 @@
using ZonyLrcTools.LocalServer.Contract.Dtos;
namespace ZonyLrcTools.LocalServer.Services.MusicInfo.Dtos;
public class MusicInfoListItemDto
{
public string Name { get; set; }
public int Size { get; set; }
public int Status { get; set; }
}
public class MusicInfoListInput : PagedListRequestDto
{
}

View File

@ -1,9 +0,0 @@
using ZonyLrcTools.LocalServer.Contract.Dtos;
using ZonyLrcTools.LocalServer.Services.MusicInfo.Dtos;
namespace ZonyLrcTools.LocalServer.Services.MusicInfo;
public interface IMusicInfoService
{
Task<PagedListResultDto<MusicInfoListItemDto>> GetMusicInfoListAsync(MusicInfoListInput input);
}

View File

@ -1,38 +0,0 @@
using ZonyLrcTools.Common.Infrastructure.DependencyInject;
using ZonyLrcTools.LocalServer.Contract.Dtos;
using ZonyLrcTools.LocalServer.Services.MusicInfo.Dtos;
namespace ZonyLrcTools.LocalServer.Services.MusicInfo;
public class MusicInfoService : ITransientDependency, IMusicInfoService
{
public async Task<PagedListResultDto<MusicInfoListItemDto>> GetMusicInfoListAsync(MusicInfoListInput input)
{
await Task.CompletedTask;
return new PagedListResultDto<MusicInfoListItemDto>
{
Items = new List<MusicInfoListItemDto>
{
new MusicInfoListItemDto
{
Name = "测试歌曲",
Size = 1024,
Status = 1
},
new MusicInfoListItemDto
{
Name = "测试歌曲2",
Size = 1024,
Status = 1
},
new MusicInfoListItemDto
{
Name = "测试歌曲3",
Size = 1024,
Status = 1
},
}
};
}
}

View File

@ -1,36 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper"/>
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection"/>
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions"/>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded"/>
<PackageReference Include="Microsoft.Extensions.Hosting"/>
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions"/>
<PackageReference Include="Serilog.Extensions.Hosting"/>
<PackageReference Include="Serilog.Sinks.Console"/>
<PackageReference Include="Serilog.Sinks.File"/>
<PackageReference Include="SuperSocket.WebSocket"/>
<PackageReference Include="SuperSocket.WebSocket.Server"/>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="UiStaticResources\**"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ZonyLrcTools.Common\ZonyLrcTools.Common.csproj"/>
</ItemGroup>
<!-- <ItemGroup>-->
<!-- <ProjectReference Include="..\ZonyLrcTools.Cli\ZonyLrcTools.Cli.csproj" />-->
<!-- </ItemGroup>-->
</Project>

View File

@ -1,8 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"Microsoft.AspNetCore": "Warning"
}
}
}

View File

@ -1,18 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"serverOptions": {
"name": "ZonyLRcToolsServer",
"listeners": [
{
"ip": "Any",
"port": 50001
}
]
}
}

View File

@ -5,12 +5,14 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Shouldly;
using Xunit;
using ZonyLrcTools.Common.Album;
namespace ZonyLrcTools.Tests.Infrastructure.Album
{
public class QQMusicAlbumDownloaderTests : TestBase
{
[Fact]
public async Task DownloadDataAsync_Test()
{
var downloader = ServiceProvider.GetRequiredService<IEnumerable<IAlbumProvider>>()

View File

@ -33,7 +33,7 @@ namespace ZonyLrcTools.Tests.Infrastructure.Lyrics
await Should.ThrowAsync<ErrorCodeException>(_lyricsProvider.DownloadAsync("天ノ弱", "漆柚").AsTask);
}
[Fact]
[Fact(Skip = "This music already exists KuGou's database.")]
public async Task DownloadAsync_Index_Exception_Test()
{
await Should.ThrowAsync<ErrorCodeException>(async () => await _lyricsProvider.DownloadAsync("40'z", "ZOOLY"));

View File

@ -113,17 +113,11 @@ namespace ZonyLrcTools.Tests.Infrastructure.Lyrics
lyric.IsPruneMusic.ShouldBeTrue();
}
[Fact]
public async Task DownloadAsync_NullException_Test()
{
var result = await Should.ThrowAsync<ErrorCodeException>(_lyricsProvider.DownloadAsync("創世記", "りりィ").AsTask);
result.ErrorCode.ShouldBe(ErrorCodes.NoMatchingSong);
}
[Fact]
public async Task DownloadAsync_Source_Null_Test()
{
var lyric = await _lyricsProvider.DownloadAsync("Concerto for Piano and Orchestra No. 12 in A major, K414 - 1. Allegro",
var lyric = await _lyricsProvider.DownloadAsync(
"Concerto for Piano and Orchestra No. 12 in A major, K414 - 1. Allegro",
"Wolfgang Amadeus Mozart");
lyric.IsPruneMusic.ShouldBeTrue();
@ -150,5 +144,12 @@ namespace ZonyLrcTools.Tests.Infrastructure.Lyrics
var lyric = await _lyricsProvider.DownloadAsync("Your Heart Is A Muscle (2012)", "Carly Rae Jepsen");
lyric.IsPruneMusic.ShouldBeFalse();
}
[Fact]
public async Task DownloadAsync_Issue_156_Test()
{
var lyric = await _lyricsProvider.DownloadAsync("你说demo", "枯木逢春");
lyric.IsPruneMusic.ShouldBeFalse();
}
}
}

View File

@ -5,6 +5,7 @@ using Shouldly;
using Xunit;
using ZonyLrcTools.Common.Configuration;
using ZonyLrcTools.Common.Infrastructure.Network;
using ZonyLrcTools.Common.Updater;
namespace ZonyLrcTools.Tests.Infrastructure.Network
{
@ -25,9 +26,9 @@ namespace ZonyLrcTools.Tests.Infrastructure.Network
{
var client = ServiceProvider.GetRequiredService<IWarpHttpClient>();
var response = await client.GetAsync(@"https://www.baidu.com");
var response = await client.GetAsync(DefaultUpdater.UpdateUrl);
response.ShouldNotBeNull();
response.ShouldContain("百度");
response.ShouldContain("NewVersion");
}
[Fact]
@ -39,10 +40,10 @@ namespace ZonyLrcTools.Tests.Infrastructure.Network
var client = ServiceProvider.GetRequiredService<IWarpHttpClient>();
var response = await client.GetAsync(@"https://www.baidu.com");
var response = await client.GetAsync(DefaultUpdater.UpdateUrl);
response.ShouldNotBeNull();
response.ShouldContain("百度");
response.ShouldContain("NewVersion");
}
}
}

View File

@ -1,4 +1,5 @@
using Shouldly;
using System.IO;
using Shouldly;
using Xunit;
using ZonyLrcTools.Common;
@ -9,7 +10,10 @@ public class MusicInfoTests
[Fact]
public void InvalidFilePathTest()
{
var musicInfo = new MusicInfo("C:\\Users\\Zony\\Music\\[ZonyLrcTools]:? - 01. 你好.mp3", "你好", "Zony");
musicInfo.FilePath.ShouldBe(@"C:\Users\Zony\Music\[ZonyLrcTools] - 01. 你好.mp3");
var tempFilePath = Path.GetTempFileName();
var errorFilePath = $"{tempFilePath}" + "?:";
var musicInfo = new MusicInfo(errorFilePath, "你好", "Zony");
musicInfo.FilePath.ShouldBe(tempFilePath);
}
}

View File

@ -1,8 +0,0 @@
New Features: NONE
Breaking Changes: None
Enhancement:
- 支持 UTF-8 BOM 编码,以解决部分设备乱码的问题。
Fixed Bugs:
- None

View File

@ -4,4 +4,4 @@ Enhancement: None
Fixed Bugs:
- 修复了酷我音乐下载歌词失败的问题。- [fea5e11](https://github.com/real-zony/ZonyLrcToolsX/commit/fea5e1124ffde5f6cfe0b993e96fdfe04e1b7892)
- 修复了 #156 的问题。