mirror of
https://github.com/real-zony/ZonyLrcToolsX.git
synced 2025-07-02 05:10:42 +00:00
Compare commits
No commits in common. "dev" and "ZonyLrcToolsX_Alpha.2023121271" have entirely different histories.
dev
...
ZonyLrcToo
2
.github/workflows/dotnet.yml
vendored
2
.github/workflows/dotnet.yml
vendored
@ -20,7 +20,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
dotnet-version: 7.0.x
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
- name: Publish
|
||||
|
@ -1,11 +0,0 @@
|
||||
<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>
|
@ -1,45 +1,46 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<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.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="Ude.NetStandard" Version="1.2.0" />
|
||||
<PackageVersion Include="YamlDotNet" Version="16.2.0" />
|
||||
</ItemGroup>
|
||||
<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"/>
|
||||
|
||||
<!-- 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"/>
|
||||
|
||||
<!-- 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"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
39
README.md
39
README.md
@ -1,38 +1,29 @@
|
||||
English | [简体中文](./zh_CN.md)
|
||||
简体中文 | [English](./docs/en_US.md)
|
||||
|
||||
# Disclaimer
|
||||
# 免责声明
|
||||
|
||||
- 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.
|
||||
- 本工具仅作个人学习研究使用,可运行的二进制文件仅用于演示功能,不得将源码及其产物用于商业用途,否则由此造成的相关法律问题,[本人](https://github.com/real-zony) 不承担任何法律责任。
|
||||
- 任何单位或个人因下载使用软件所产生的任何意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、附带或衍生的损失等),[本人](https://github.com/real-zony) 不承担任何法律责任。
|
||||
- 用户明确并同意本声明条款列举的全部内容,对使用本工具可能存在的风险和相关后果将完全由用户自行承担,[本人](https://github.com/real-zony) 不承担任何法律责任。
|
||||
|
||||
# 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.
|
||||
ZonyLrcToolX 4 是一个基于 CEF 的跨平台歌词下载工具,**QQ 群:337656932**,群文件里面有详细的视频教程。
|
||||
|
||||
🚧 The current version is under development.
|
||||
🚧 If you want to see working code, please switch to the dev branch.
|
||||
🚧 当前版本正在开发当中。
|
||||
🚧 如果你想查看可以工作的代码,请切换到 dev 分支。
|
||||
|
||||
# Download
|
||||
# 下载
|
||||
|
||||
To get the latest version, please visit the **[Release](https://github.com/real-zony/ZonyLrcToolsX/releases)** page for download.
|
||||
如果你要获取最新版本,请访问 **[Release](https://github.com/real-zony/ZonyLrcToolsX/releases)** 页面进行下载。
|
||||
|
||||
## Arch Linux User Repository
|
||||
# 用法
|
||||
|
||||
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:
|
||||
软件的具体使用方法已经迁移到了全新的文档站点,请跳转到 [https://docs.myzony.com](https://docs.myzony.com),里面包含完整的说明文档。
|
||||
|
||||
```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)
|
||||
<img src="./docs/img/alipay.jpg" width="200"/><img src="./docs/img/wechat.jpg" width="200"/>
|
||||
|
||||
# Star History
|
||||
|
||||
|
@ -11,8 +11,12 @@ 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
|
||||
@ -27,10 +31,18 @@ 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
|
||||
@ -41,6 +53,8 @@ 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
|
||||
|
@ -1,39 +1,18 @@
|
||||
English | [简体中文](./zh_CN.md)
|
||||
|
||||
# Disclaimer
|
||||
## Overview
|
||||
|
||||
- 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.
|
||||
ZonyLrcToolX 2.0 is a cross-platform lyric downlaod tool based on CEF.
|
||||
|
||||
# Introduction
|
||||
🚧 The current version is under development.
|
||||
🚧 If you want to see the working code, please switch to the 1.0 branch.
|
||||
|
||||
ZonyLrcToolX 4 is a cross-platform lyrics download tool based on CEF. **QQ Group: 337656932**. Detailed video tutorials are available in the group files.
|
||||
## Usage
|
||||
|
||||
🚧 The current version is under development.
|
||||
🚧 If you want to see working code, please switch to the dev branch.
|
||||
## Donation
|
||||
|
||||
# Download
|
||||
## Roadmap
|
||||
|
||||
To get the latest version, please visit the **[Release](https://github.com/real-zony/ZonyLrcToolsX/releases)** page for download.
|
||||
|
||||
## Arch Linux User Repository
|
||||
|
||||
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
|
||||
|
||||
[](https://star-history.com/#real-zony/ZonyLrcToolsX&Timeline)
|
||||
- [ ] Supports cross-platform CLI tools.
|
||||
- [ ] Web GUI based site (local).
|
||||
- [ ] Support plug-in system (Lua Engine).
|
BIN
docs/img/alipay.jpg
Normal file
BIN
docs/img/alipay.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 247 KiB |
BIN
docs/img/wechat.jpg
Normal file
BIN
docs/img/wechat.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 211 KiB |
@ -1,40 +0,0 @@
|
||||
简体中文 | [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
|
||||
|
||||
[](https://star-history.com/#real-zony/ZonyLrcToolsX&Timeline)
|
@ -81,7 +81,8 @@ namespace ZonyLrcTools.Cli
|
||||
.ConfigureLogging(l => l.AddSerilog())
|
||||
.ConfigureHostConfiguration(builder =>
|
||||
{
|
||||
builder.SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
|
||||
builder
|
||||
.SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
|
||||
.AddYamlFile("config.yaml");
|
||||
})
|
||||
.ConfigureServices((_, services) =>
|
||||
|
@ -3,6 +3,10 @@
|
||||
<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>
|
||||
@ -14,7 +18,6 @@
|
||||
<PackageReference Include="Serilog.Sinks.Console"/>
|
||||
<PackageReference Include="Serilog.Sinks.File"/>
|
||||
<PackageReference Include="System.Text.Encoding.CodePages"/>
|
||||
<PackageReference Include="Ude.NetStandard"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -1,61 +1,61 @@
|
||||
# 允许扫描的歌曲文件后缀名。
|
||||
supportFileExtensions:
|
||||
- '*.mp3'
|
||||
- '*.flac'
|
||||
- '*.wav'
|
||||
- '*.m4a'
|
||||
- '*.ogg'
|
||||
- '*.opus'
|
||||
|
||||
# 网络代理服务设置,仅支持 HTTP 代理。
|
||||
networkOptions:
|
||||
isEnable: false # 是否启用代理。
|
||||
ip: 127.0.0.1 # 代理服务 IP 地址。
|
||||
port: 4780 # 代理服务端口号。
|
||||
updateUrl: https://api.myzony.com/lrc-tools/update # 更新检查地址。
|
||||
|
||||
# 下载器的相关参数配置。
|
||||
provider:
|
||||
# 标签扫描器的相关参数配置。
|
||||
tag:
|
||||
# 支持的标签扫描器。
|
||||
plugin:
|
||||
- name: Taglib # 基于 Taglib 库的标签扫描器。
|
||||
priority: 1 # 优先级,升序排列。
|
||||
- name: FileName # 基于文件名的标签扫描器。
|
||||
priority: 2
|
||||
# 基于文件名扫描器的扩展参数。
|
||||
extensions:
|
||||
# 正则表达式,用于匹配文件名中的作者信息和歌曲信息,可根据
|
||||
# 自己的需求进行调整。
|
||||
regularExpressions: "(?'artist'.+)\\s-\\s(?'name'.+)"
|
||||
# 歌曲标签屏蔽字典替换功能。
|
||||
blockWord:
|
||||
isEnable: false # 是否启用屏蔽字典。
|
||||
filePath: 'BlockWords.json' # 屏蔽字典的路径。
|
||||
# 歌词下载器的相关参数配置。
|
||||
lyric:
|
||||
# 支持的歌词下载器。
|
||||
plugin:
|
||||
- name: NetEase # 基于网易云音乐的歌词下载器。
|
||||
priority: 1 # 优先级,升序排列,改为 -1 时禁用。
|
||||
depth: 10 # 搜索深度,值越大搜索结果越多,但搜索时间越长。
|
||||
additional:
|
||||
isEnableRomanOutput: false # 是否启用罗马音输出,本参数仅当对应歌曲有罗马音歌词时有效。
|
||||
- name: QQ # 基于 QQ 音乐的歌词下载器。
|
||||
priority: 2
|
||||
# depth: 10 # 暂时不支持。
|
||||
- name: KuGou # 基于酷狗音乐的歌词下载器。
|
||||
priority: 3
|
||||
depth: 10
|
||||
- name: KuWo # 基于酷我音乐的歌词下载器。
|
||||
priority: 4
|
||||
depth: 10
|
||||
# 歌词下载的一些共有配置参数。
|
||||
config:
|
||||
isOneLine: true # 双语歌词是否合并为一行展示。
|
||||
lineBreak: "\n" # 换行符的类型,记得使用双引号指定。
|
||||
isEnableTranslation: true # 是否启用翻译歌词。
|
||||
isOnlyOutputTranslation: false # 是否只输出翻译歌词。
|
||||
isSkipExistLyricFiles: false # 如果歌词文件已经存在,是否跳过这些文件。
|
||||
fileEncoding: 'utf-8' # 歌词文件的编码格式。
|
||||
globalOption:
|
||||
# 允许扫描的歌曲文件后缀名。
|
||||
supportFileExtensions:
|
||||
- '*.mp3'
|
||||
- '*.flac'
|
||||
- '*.wav'
|
||||
- '*.m4a'
|
||||
- '*.ogg'
|
||||
- '*.opus'
|
||||
# 网络代理服务设置,仅支持 HTTP 代理。
|
||||
networkOptions:
|
||||
isEnable: false # 是否启用代理。
|
||||
ip: 127.0.0.1 # 代理服务 IP 地址。
|
||||
port: 4780 # 代理服务端口号。
|
||||
updateUrl: https://api.myzony.com/lrc-tools/update # 更新检查地址。
|
||||
|
||||
# 下载器的相关参数配置。
|
||||
provider:
|
||||
# 标签扫描器的相关参数配置。
|
||||
tag:
|
||||
# 支持的标签扫描器。
|
||||
plugin:
|
||||
- name: Taglib # 基于 Taglib 库的标签扫描器。
|
||||
priority: 1 # 优先级,升序排列。
|
||||
- name: FileName # 基于文件名的标签扫描器。
|
||||
priority: 2
|
||||
# 基于文件名扫描器的扩展参数。
|
||||
extensions:
|
||||
# 正则表达式,用于匹配文件名中的作者信息和歌曲信息,可根据
|
||||
# 自己的需求进行调整。
|
||||
regularExpressions: "(?'artist'.+)\\s-\\s(?'name'.+)"
|
||||
# 歌曲标签屏蔽字典替换功能。
|
||||
blockWord:
|
||||
isEnable: false # 是否启用屏蔽字典。
|
||||
filePath: 'BlockWords.json' # 屏蔽字典的路径。
|
||||
# 歌词下载器的相关参数配置。
|
||||
lyric:
|
||||
# 支持的歌词下载器。
|
||||
plugin:
|
||||
- name: NetEase # 基于网易云音乐的歌词下载器。
|
||||
priority: 1 # 优先级,升序排列,改为 -1 时禁用。
|
||||
depth: 10 # 搜索深度,值越大搜索结果越多,但搜索时间越长。
|
||||
additional:
|
||||
isEnableRomanOutput: false # 是否启用罗马音输出,本参数仅当对应歌曲有罗马音歌词时有效。
|
||||
- name: QQ # 基于 QQ 音乐的歌词下载器。
|
||||
priority: 2
|
||||
# depth: 10 # 暂时不支持。
|
||||
- name: KuGou # 基于酷狗音乐的歌词下载器。
|
||||
priority: 3
|
||||
depth: 10
|
||||
- name: KuWo # 基于酷我音乐的歌词下载器。
|
||||
priority: 4
|
||||
depth: 10
|
||||
# 歌词下载的一些共有配置参数。
|
||||
config:
|
||||
isOneLine: true # 双语歌词是否合并为一行展示。
|
||||
lineBreak: "\n" # 换行符的类型,记得使用双引号指定。
|
||||
isEnableTranslation: true # 是否启用翻译歌词。
|
||||
isOnlyOutputTranslation: false # 是否只输出翻译歌词。
|
||||
isSkipExistLyricFiles: false # 如果歌词文件已经存在,是否跳过这些文件。
|
||||
fileEncoding: 'utf-8' # 歌词文件的编码格式。
|
@ -16,10 +16,5 @@
|
||||
/// 搜索深度,值越大搜索结果越多,但搜索时间越长。
|
||||
/// </summary>
|
||||
public int Depth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 歌词下载器的扩展属性。
|
||||
/// </summary>
|
||||
public Dictionary<string, string>? Additional { get; set; }
|
||||
}
|
||||
}
|
@ -19,10 +19,5 @@ namespace ZonyLrcTools.Common.Configuration
|
||||
/// 代理服务器的 端口。
|
||||
/// </summary>
|
||||
public int Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新检查的 Url。
|
||||
/// </summary>
|
||||
public string UpdateUrl { get; set; } = default!;
|
||||
}
|
||||
}
|
@ -8,9 +8,4 @@ public class TagInfoOptions
|
||||
/// 屏蔽词功能相关配置。
|
||||
/// </summary>
|
||||
public BlockWordOptions BlockWord { get; set; } = null!;
|
||||
|
||||
public TagInfoProviderOptions GetTagProviderOption(string name)
|
||||
{
|
||||
return Plugin.FirstOrDefault(x => x.Name == name)!;
|
||||
}
|
||||
}
|
@ -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!;
|
||||
}
|
||||
}
|
@ -47,7 +47,7 @@ namespace ZonyLrcTools.Common.Infrastructure.DependencyInject
|
||||
.AddYamlFile("config.yaml")
|
||||
.Build();
|
||||
|
||||
services.Configure<GlobalOptions>(configuration);
|
||||
services.Configure<GlobalOptions>(configuration.GetSection("globalOption"));
|
||||
|
||||
return services;
|
||||
}
|
||||
|
@ -10,11 +10,9 @@ 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 = 1,
|
||||
Func<MusicInfo, Task>? callback = null,
|
||||
int parallelCount = 2,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
|
@ -10,7 +10,6 @@ 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;
|
||||
@ -39,7 +38,6 @@ 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("开始下载歌词文件数据...");
|
||||
@ -59,12 +57,12 @@ public class LyricsDownloader : ILyricsDownloader, ISingletonDependency
|
||||
{
|
||||
await DownloadAndWriteLyricsAsync(lyricsProvider, info);
|
||||
|
||||
if (!info.IsSuccessful) continue;
|
||||
_logger.LogSuccessful(info);
|
||||
break;
|
||||
if (info.IsSuccessful)
|
||||
{
|
||||
_logger.LogSuccessful(info);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (callback != null) await callback(info);
|
||||
}, cancellationToken), cancellationToken));
|
||||
|
||||
await Task.WhenAll(downloadTasks);
|
||||
|
@ -8,7 +8,7 @@ using ZonyLrcTools.Common.Lyrics.Providers.KuGou.JsonModel;
|
||||
|
||||
namespace ZonyLrcTools.Common.Lyrics.Providers.KuGou
|
||||
{
|
||||
public class KuGouLyricsProvider : LyricsProvider
|
||||
public class KuGourLyricsProvider : 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 KuGouLyricsProvider(IWarpHttpClient warpHttpClient,
|
||||
public KuGourLyricsProvider(IWarpHttpClient warpHttpClient,
|
||||
ILyricsItemCollectionFactory lyricsItemCollectionFactory,
|
||||
IOptions<GlobalOptions> options)
|
||||
{
|
@ -4,49 +4,13 @@ namespace ZonyLrcTools.Common.Lyrics.Providers.KuWo.JsonModel;
|
||||
|
||||
public class SongSearchRequest
|
||||
{
|
||||
[JsonProperty("all")] public string Keyword { get; set; }
|
||||
[JsonProperty("key")] public string Keyword { get; set; }
|
||||
|
||||
[JsonProperty("pn")] public int PageNumber { get; }
|
||||
|
||||
[JsonProperty("rn")] public int PageSize { get; }
|
||||
|
||||
[JsonProperty("ft")] public string Unknown1 { get; } = "music";
|
||||
|
||||
[JsonProperty("newsearch")] public string Unknown2 { get; } = "1";
|
||||
|
||||
[JsonProperty("alflac")] public string Unknown3 { get; } = "1";
|
||||
|
||||
[JsonProperty("itemset")] public string Unknown4 { get; } = "web_2013";
|
||||
|
||||
[JsonProperty("client")] public string Unknown5 { get; } = "kt";
|
||||
|
||||
[JsonProperty("cluster")] public string Unknown6 { get; } = "0";
|
||||
|
||||
[JsonProperty("vermerge")] public string Unknown7 { get; } = "1";
|
||||
|
||||
[JsonProperty("rformat")] public string Unknown8 { get; } = "json";
|
||||
|
||||
[JsonProperty("encoding")] public string Unknown9 { get; } = "utf8";
|
||||
|
||||
[JsonProperty("show_copyright_off")] public string Unknown10 { get; } = "1";
|
||||
|
||||
[JsonProperty("pcmp4")] public string Unknown11 { get; } = "1";
|
||||
|
||||
[JsonProperty("ver")] public string Unknown12 { get; } = "mbox";
|
||||
|
||||
[JsonProperty("plat")] public string Unknown13 { get; } = "pc";
|
||||
|
||||
[JsonProperty("vipver")] public string Unknown14 { get; } = "MUSIC_9.2.0.0_W6";
|
||||
|
||||
[JsonProperty("devid")] public string Unknown15 { get; } = "11404450";
|
||||
|
||||
[JsonProperty("newver")] public string Unknown16 { get; } = "1";
|
||||
|
||||
[JsonProperty("issubtitle")] public string Unknown17 { get; } = "1";
|
||||
|
||||
[JsonProperty("pcjson")] public string Unknown18 { get; } = "1";
|
||||
|
||||
public SongSearchRequest(string name, string artist, int pageNumber = 0, int pageSize = 20)
|
||||
public SongSearchRequest(string name, string artist, int pageNumber = 1, int pageSize = 20)
|
||||
{
|
||||
Keyword = $"{name} {artist}";
|
||||
PageNumber = pageNumber;
|
||||
|
@ -4,14 +4,15 @@ namespace ZonyLrcTools.Common.Lyrics.Providers.KuWo.JsonModel;
|
||||
|
||||
public class SongSearchResponse
|
||||
{
|
||||
[JsonProperty("TOTAL")] public int TotalCount { get; set; }
|
||||
[JsonProperty("code")] public int Code { get; set; }
|
||||
|
||||
[JsonProperty("abslist")]
|
||||
public IList<SongSearchResponseSongDetail> SongList { get; set; }
|
||||
[JsonProperty("data")] public SongSearchResponseInnerData InnerData { get; set; } = null!;
|
||||
|
||||
[JsonProperty("msg")] public string? ErrorMessage { get; set; }
|
||||
|
||||
public long GetMatchedMusicId(string musicName, string artistName, long? duration)
|
||||
{
|
||||
var prefectMatch = SongList.FirstOrDefault(x => x.Name == musicName && x.Artist == artistName);
|
||||
var prefectMatch = InnerData.SongItems.FirstOrDefault(x => x.Name == musicName && x.Artist == artistName);
|
||||
if (prefectMatch != null)
|
||||
{
|
||||
return prefectMatch.MusicId;
|
||||
@ -19,42 +20,27 @@ public class SongSearchResponse
|
||||
|
||||
if (duration is null or 0)
|
||||
{
|
||||
return SongList.First().MusicId;
|
||||
return InnerData.SongItems.First().MusicId;
|
||||
}
|
||||
|
||||
return SongList.OrderBy(t => Math.Abs(t.Duration - duration.Value)).First().MusicId;
|
||||
return InnerData.SongItems.OrderBy(t => Math.Abs(t.Duration - duration.Value)).First().MusicId;
|
||||
}
|
||||
}
|
||||
|
||||
public class SongSearchResponseSongDetail
|
||||
public class SongSearchResponseInnerData
|
||||
{
|
||||
/// <summary>
|
||||
/// 专辑名称。
|
||||
/// </summary>
|
||||
[JsonProperty("ALBUM")]
|
||||
public string Album { get; set; }
|
||||
[JsonProperty("total")] public string? Total { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 歌手名称。
|
||||
/// </summary>
|
||||
[JsonProperty("ARTIST")]
|
||||
public string Artist { get; set; }
|
||||
[JsonProperty("list")] public ICollection<SongSearchResponseDetail> SongItems { get; set; } = null!;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 歌曲名称。
|
||||
/// </summary>
|
||||
[JsonProperty("SONGNAME")]
|
||||
public string Name { get; set; }
|
||||
public class SongSearchResponseDetail
|
||||
{
|
||||
[JsonProperty("artist")] public string? Artist { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 歌曲的 ID。
|
||||
/// </summary>
|
||||
[JsonProperty("DC_TARGETID")]
|
||||
public long MusicId { get; set; }
|
||||
[JsonProperty("name")] public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 歌曲的时间长度。
|
||||
/// </summary>
|
||||
[JsonProperty("DURATION")]
|
||||
public long Duration { get; set; }
|
||||
[JsonProperty("rid")] public long MusicId { get; set; }
|
||||
|
||||
[JsonProperty("duration")] public long Duration { get; set; }
|
||||
}
|
@ -13,27 +13,29 @@ public class KuWoLyricsProvider : LyricsProvider
|
||||
{
|
||||
public override string DownloaderName => InternalLyricsProviderNames.KuWo;
|
||||
|
||||
private const string KuWoSearchMusicUrl = @"https://search.kuwo.cn/r.s";
|
||||
private const string KuWoSearchMusicUrl = @"https://www.kuwo.cn/api/www/search/searchMusicBykeyWord";
|
||||
private const string KuWoSearchLyricsUrl = @"https://m.kuwo.cn/newh5/singles/songinfoandlrc";
|
||||
private const string KuWoDefaultToken = "ABCDE12345";
|
||||
|
||||
private readonly IWarpHttpClient _warpHttpClient;
|
||||
private readonly ILyricsItemCollectionFactory _lyricsItemCollectionFactory;
|
||||
private readonly GlobalOptions _options;
|
||||
|
||||
private static readonly ProductInfoHeaderValue UserAgent = new("Chrome", "81.0.4044.138");
|
||||
|
||||
public KuWoLyricsProvider(IWarpHttpClient warpHttpClient,
|
||||
ILyricsItemCollectionFactory lyricsItemCollectionFactory,
|
||||
IOptions<GlobalOptions> options)
|
||||
{
|
||||
_warpHttpClient = warpHttpClient;
|
||||
_lyricsItemCollectionFactory = lyricsItemCollectionFactory;
|
||||
_options = options.Value;
|
||||
}
|
||||
|
||||
protected override async ValueTask<object> DownloadDataAsync(LyricsProviderArgs args)
|
||||
{
|
||||
var songSearchResponse = await _warpHttpClient.GetAsync<SongSearchResponse>(KuWoSearchMusicUrl,
|
||||
new SongSearchRequest(args.SongName, args.Artist,
|
||||
pageSize: _options.Provider.Lyric.GetLyricProviderOption(DownloaderName).Depth),
|
||||
new SongSearchRequest(args.SongName, args.Artist, pageSize: _options.Provider.Lyric.GetLyricProviderOption(DownloaderName).Depth),
|
||||
op =>
|
||||
{
|
||||
op.Headers.UserAgent.Add(UserAgent);
|
||||
@ -53,8 +55,7 @@ public class KuWoLyricsProvider : LyricsProvider
|
||||
});
|
||||
}
|
||||
|
||||
protected override async ValueTask<LyricsItemCollection> GenerateLyricAsync(object lyricsObject,
|
||||
LyricsProviderArgs args)
|
||||
protected override async ValueTask<LyricsItemCollection> GenerateLyricAsync(object lyricsObject, LyricsProviderArgs args)
|
||||
{
|
||||
await ValueTask.CompletedTask;
|
||||
|
||||
@ -68,8 +69,7 @@ public class KuWoLyricsProvider : LyricsProvider
|
||||
{
|
||||
var position = double.Parse(l.Position);
|
||||
var positionSpan = TimeSpan.FromSeconds(position);
|
||||
return new LyricsItem(positionSpan.Minutes,
|
||||
double.Parse($"{positionSpan.Seconds}.{positionSpan.Milliseconds}"), l.Text);
|
||||
return new LyricsItem(positionSpan.Minutes, double.Parse($"{positionSpan.Seconds}.{positionSpan.Milliseconds}"), l.Text);
|
||||
});
|
||||
|
||||
var lyricsItemCollection = new LyricsItemCollection(_options.Provider.Lyric.Config);
|
||||
@ -79,7 +79,12 @@ public class KuWoLyricsProvider : LyricsProvider
|
||||
|
||||
protected virtual void ValidateSongSearchResponse(SongSearchResponse response, LyricsProviderArgs args)
|
||||
{
|
||||
if (response.TotalCount == 0)
|
||||
if (response.Code != 200)
|
||||
{
|
||||
throw new ErrorCodeException(ErrorCodes.TheReturnValueIsIllegal, response.ErrorMessage, args);
|
||||
}
|
||||
|
||||
if (response.InnerData.SongItems.Count == 0)
|
||||
{
|
||||
throw new ErrorCodeException(ErrorCodes.NoMatchingSong, attachObj: args);
|
||||
}
|
||||
|
@ -4,13 +4,13 @@ namespace ZonyLrcTools.Common.Lyrics.Providers.NetEase.JsonModel
|
||||
{
|
||||
public class GetSongDetailsRequest
|
||||
{
|
||||
public GetSongDetailsRequest(long songId)
|
||||
public GetSongDetailsRequest(int songId)
|
||||
{
|
||||
SongId = songId;
|
||||
SongIds = $"%5B{songId}%5D";
|
||||
}
|
||||
|
||||
[JsonProperty("id")] public long SongId { get; }
|
||||
[JsonProperty("id")] public int SongId { get; }
|
||||
|
||||
[JsonProperty("ids")] public string SongIds { get; }
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ namespace ZonyLrcTools.Common.Lyrics.Providers.NetEase.JsonModel
|
||||
|
||||
[JsonProperty("code")] public int StatusCode { get; set; }
|
||||
|
||||
public long GetFirstMatchSongId(string songName, long? duration)
|
||||
public int 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 long Id { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 歌曲的演唱者。
|
||||
|
@ -57,25 +57,5 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
using System.Text;
|
||||
using Ude;
|
||||
using ZonyLrcTools.Common.Infrastructure.DependencyInject;
|
||||
|
||||
namespace ZonyLrcTools.Common.MusicScanner;
|
||||
@ -15,15 +13,11 @@ 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 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();
|
||||
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();
|
||||
}
|
||||
|
||||
private MusicInfo GetMusicInfoFromCsvFileLine(string csvFileLine, string outputDirectory, string pattern)
|
||||
@ -35,19 +29,4 @@ 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;
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
// namespace ZonyLrcTools.Common.MusicScanner;
|
||||
//
|
||||
// public class QQMusicSongListMusicScanner : IMusicScanner
|
||||
// {
|
||||
// }
|
@ -4,6 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>4.0.0.57</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -15,8 +16,6 @@
|
||||
<PackageReference Include="Polly"/>
|
||||
<PackageReference Include="QRCoder"/>
|
||||
<PackageReference Include="TagLibSharp"/>
|
||||
<PackageReference Include="Ude.NetStandard" />
|
||||
<PackageReference Include="YamlDotNet" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
15
src/ZonyLrcTools.Desktop/App.axaml
Normal file
15
src/ZonyLrcTools.Desktop/App.axaml
Normal file
@ -0,0 +1,15 @@
|
||||
<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>
|
28
src/ZonyLrcTools.Desktop/App.axaml.cs
Normal file
28
src/ZonyLrcTools.Desktop/App.axaml.cs
Normal file
@ -0,0 +1,28 @@
|
||||
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();
|
||||
}
|
||||
}
|
BIN
src/ZonyLrcTools.Desktop/Assets/avalonia-logo.ico
Normal file
BIN
src/ZonyLrcTools.Desktop/Assets/avalonia-logo.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 172 KiB |
23
src/ZonyLrcTools.Desktop/Program.cs
Normal file
23
src/ZonyLrcTools.Desktop/Program.cs
Normal file
@ -0,0 +1,23 @@
|
||||
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();
|
||||
}
|
27
src/ZonyLrcTools.Desktop/ViewLocator.cs
Normal file
27
src/ZonyLrcTools.Desktop/ViewLocator.cs
Normal file
@ -0,0 +1,27 @@
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
namespace ZonyLrcTools.Desktop.ViewModels;
|
||||
|
||||
public class MainWindowViewModel : ViewModelBase
|
||||
{
|
||||
public string Greeting => "Welcome to Avalonia!";
|
||||
}
|
7
src/ZonyLrcTools.Desktop/ViewModels/ViewModelBase.cs
Normal file
7
src/ZonyLrcTools.Desktop/ViewModels/ViewModelBase.cs
Normal file
@ -0,0 +1,7 @@
|
||||
using ReactiveUI;
|
||||
|
||||
namespace ZonyLrcTools.Desktop.ViewModels;
|
||||
|
||||
public class ViewModelBase : ReactiveObject
|
||||
{
|
||||
}
|
20
src/ZonyLrcTools.Desktop/Views/MainWindow.axaml
Normal file
20
src/ZonyLrcTools.Desktop/Views/MainWindow.axaml
Normal file
@ -0,0 +1,20 @@
|
||||
<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>
|
11
src/ZonyLrcTools.Desktop/Views/MainWindow.axaml.cs
Normal file
11
src/ZonyLrcTools.Desktop/Views/MainWindow.axaml.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace ZonyLrcTools.Desktop.Views;
|
||||
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
25
src/ZonyLrcTools.Desktop/ZonyLrcTools.Desktop.csproj
Normal file
25
src/ZonyLrcTools.Desktop/ZonyLrcTools.Desktop.csproj
Normal file
@ -0,0 +1,25 @@
|
||||
<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>
|
18
src/ZonyLrcTools.Desktop/app.manifest
Normal file
18
src/ZonyLrcTools.Desktop/app.manifest
Normal file
@ -0,0 +1,18 @@
|
||||
<?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>
|
@ -0,0 +1,7 @@
|
||||
namespace ZonyLrcTools.LocalServer.Contract.Dtos;
|
||||
|
||||
public class PagedListRequestDto
|
||||
{
|
||||
public int PageIndex { get; set; }
|
||||
public int PageSize { get; set; }
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
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>();
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
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);
|
||||
}
|
||||
}
|
15
src/ZonyLrcTools.LocalServer/EventBus/SuperSocketListener.cs
Normal file
15
src/ZonyLrcTools.LocalServer/EventBus/SuperSocketListener.cs
Normal file
@ -0,0 +1,15 @@
|
||||
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();
|
||||
}
|
||||
}
|
66
src/ZonyLrcTools.LocalServer/Program.cs
Normal file
66
src/ZonyLrcTools.LocalServer/Program.cs
Normal file
@ -0,0 +1,66 @@
|
||||
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
|
14
src/ZonyLrcTools.LocalServer/Properties/launchSettings.json
Normal file
14
src/ZonyLrcTools.LocalServer/Properties/launchSettings.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/launchsettings.json",
|
||||
"profiles": {
|
||||
"ZonyLrcTools.LocalServer": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "http://localhost:50002",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
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
|
||||
{
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
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);
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
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
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
36
src/ZonyLrcTools.LocalServer/ZonyLrcTools.LocalServer.csproj
Normal file
36
src/ZonyLrcTools.LocalServer/ZonyLrcTools.LocalServer.csproj
Normal file
@ -0,0 +1,36 @@
|
||||
<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>
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Debug",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
18
src/ZonyLrcTools.LocalServer/appsettings.json
Normal file
18
src/ZonyLrcTools.LocalServer/appsettings.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"serverOptions": {
|
||||
"name": "ZonyLRcToolsServer",
|
||||
"listeners": [
|
||||
{
|
||||
"ip": "Any",
|
||||
"port": 50001
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -5,14 +5,12 @@ 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>>()
|
||||
|
@ -33,7 +33,7 @@ namespace ZonyLrcTools.Tests.Infrastructure.Lyrics
|
||||
await Should.ThrowAsync<ErrorCodeException>(_lyricsProvider.DownloadAsync("天ノ弱", "漆柚").AsTask);
|
||||
}
|
||||
|
||||
[Fact(Skip = "This music already exists KuGou's database.")]
|
||||
[Fact]
|
||||
public async Task DownloadAsync_Index_Exception_Test()
|
||||
{
|
||||
await Should.ThrowAsync<ErrorCodeException>(async () => await _lyricsProvider.DownloadAsync("40'z", "ZOOLY"));
|
||||
|
@ -17,7 +17,7 @@ public class KuWoLyricsProviderTests : TestBase
|
||||
.FirstOrDefault(t => t.DownloaderName == InternalLyricsProviderNames.KuWo);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(Skip = "Not Working")]
|
||||
[Trait("LyricsProvider ", "KuGou")]
|
||||
public async Task DownloadAsync_Test()
|
||||
{
|
||||
@ -26,7 +26,7 @@ public class KuWoLyricsProviderTests : TestBase
|
||||
lyric.IsPruneMusic.ShouldBeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(Skip = "Not Working")]
|
||||
public async Task DownloadAsync_Source_Null_Test()
|
||||
{
|
||||
var lyric = await _kuwoLyricsProvider.DownloadAsync("Concerto for Piano and Orchestra No. 12 in A major, K414 - 1. Allegro",
|
||||
|
@ -113,11 +113,17 @@ 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();
|
||||
@ -144,12 +150,5 @@ 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();
|
||||
}
|
||||
}
|
||||
}
|
@ -5,7 +5,6 @@ using Shouldly;
|
||||
using Xunit;
|
||||
using ZonyLrcTools.Common.Configuration;
|
||||
using ZonyLrcTools.Common.Infrastructure.Network;
|
||||
using ZonyLrcTools.Common.Updater;
|
||||
|
||||
namespace ZonyLrcTools.Tests.Infrastructure.Network
|
||||
{
|
||||
@ -26,9 +25,9 @@ namespace ZonyLrcTools.Tests.Infrastructure.Network
|
||||
{
|
||||
var client = ServiceProvider.GetRequiredService<IWarpHttpClient>();
|
||||
|
||||
var response = await client.GetAsync(DefaultUpdater.UpdateUrl);
|
||||
var response = await client.GetAsync(@"https://www.baidu.com");
|
||||
response.ShouldNotBeNull();
|
||||
response.ShouldContain("NewVersion");
|
||||
response.ShouldContain("百度");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -40,10 +39,10 @@ namespace ZonyLrcTools.Tests.Infrastructure.Network
|
||||
|
||||
var client = ServiceProvider.GetRequiredService<IWarpHttpClient>();
|
||||
|
||||
var response = await client.GetAsync(DefaultUpdater.UpdateUrl);
|
||||
var response = await client.GetAsync(@"https://www.baidu.com");
|
||||
|
||||
response.ShouldNotBeNull();
|
||||
response.ShouldContain("NewVersion");
|
||||
response.ShouldContain("百度");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
using System.IO;
|
||||
using Shouldly;
|
||||
using Shouldly;
|
||||
using Xunit;
|
||||
using ZonyLrcTools.Common;
|
||||
|
||||
@ -10,10 +9,7 @@ public class MusicInfoTests
|
||||
[Fact]
|
||||
public void InvalidFilePathTest()
|
||||
{
|
||||
var tempFilePath = Path.GetTempFileName();
|
||||
var errorFilePath = $"{tempFilePath}" + "?:";
|
||||
|
||||
var musicInfo = new MusicInfo(errorFilePath, "你好", "Zony");
|
||||
musicInfo.FilePath.ShouldBe(tempFilePath);
|
||||
var musicInfo = new MusicInfo("C:\\Users\\Zony\\Music\\[ZonyLrcTools]:? - 01. 你好.mp3", "你好", "Zony");
|
||||
musicInfo.FilePath.ShouldBe(@"C:\Users\Zony\Music\[ZonyLrcTools] - 01. 你好.mp3");
|
||||
}
|
||||
}
|
8
versions/release.bak.md
Normal file
8
versions/release.bak.md
Normal file
@ -0,0 +1,8 @@
|
||||
New Features: NONE
|
||||
|
||||
Breaking Changes: None
|
||||
Enhancement:
|
||||
- 支持 UTF-8 BOM 编码,以解决部分设备乱码的问题。
|
||||
|
||||
Fixed Bugs:
|
||||
- None
|
@ -4,4 +4,5 @@ Enhancement: None
|
||||
|
||||
Fixed Bugs:
|
||||
|
||||
- 修复了 #156 的问题。
|
||||
- 修复了网易云音歌词下载功能无效的问题。- [243a0e2](https://github.com/real-zony/ZonyLrcToolsX/commit/243a0e2559d3d9925dfcb96d11e2c1b1372363e6)
|
||||
- 修复了日志不正常显示的问题。
|
Loading…
x
Reference in New Issue
Block a user