mirror of
https://github.com/jayfunc/BetterLyrics.git
synced 2026-01-13 03:34:55 +08:00
Compare commits
3 Commits
v1.0.112.0
...
v1.0.113.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6820e59597 | ||
|
|
c7b0d409ad | ||
|
|
6c942657fc |
22
.github/ISSUE_TEMPLATE/bug-反馈.md
vendored
Normal file
22
.github/ISSUE_TEMPLATE/bug-反馈.md
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
name: Bug 反馈
|
||||
about: 帮助我们改进 BetterLyrics
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**描述问题**
|
||||
|
||||
|
||||
**屏幕截图**
|
||||
|
||||
|
||||
**BetterLyrics 版本**
|
||||
v1.0.XX.0
|
||||
|
||||
**日志**
|
||||
将日志以单文件形式上传到此处。你可以在此处找到日志文件 `%LocalAppData%\Packages\37412.BetterLyrics_rd1g0rsrrtxw8\LocalCache\logs`
|
||||
|
||||
**附加信息**
|
||||
21
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
21
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
|
||||
|
||||
**Screenshots**
|
||||
|
||||
**BetterLyrics Version**
|
||||
v1.0.XX.0
|
||||
|
||||
**Logs**
|
||||
Upload logs as a file here. You can find logs at `%LocalAppData%\Packages\37412.BetterLyrics_rd1g0rsrrtxw8\LocalCache\logs`
|
||||
|
||||
**Additional context**
|
||||
13
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
13
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the solution you'd like**
|
||||
|
||||
|
||||
**Additional context**
|
||||
13
.github/ISSUE_TEMPLATE/功能建议.md
vendored
Normal file
13
.github/ISSUE_TEMPLATE/功能建议.md
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
name: 功能建议
|
||||
about: 提供宝贵的功能建议
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**描述你所构想的解决方案**
|
||||
|
||||
|
||||
**附加信息**
|
||||
@@ -315,15 +315,27 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
// data URL,直接解析
|
||||
return DataUrlToByteArray(url);
|
||||
}
|
||||
else if (Uri.TryCreate(url, UriKind.Absolute, out var uri) &&
|
||||
(uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps))
|
||||
else if (Uri.TryCreate(url, UriKind.Absolute, out var uri))
|
||||
{
|
||||
// 普通网络图片,下载
|
||||
return await DownloadImageAsByteArrayAsync(url);
|
||||
if (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps)
|
||||
{
|
||||
// 普通网络图片,下载
|
||||
return await DownloadImageAsByteArrayAsync(url);
|
||||
}
|
||||
else if (uri.Scheme == Uri.UriSchemeFile)
|
||||
{
|
||||
// 本地文件,读取
|
||||
var file = await StorageFile.GetFileFromPathAsync(uri.LocalPath);
|
||||
var buffer = await FileIO.ReadBufferAsync(file);
|
||||
return buffer.ToArray();
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 其他类型暂不支持
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,17 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
var vault = new PasswordVault();
|
||||
|
||||
// 删除旧值(避免重复存储)
|
||||
var oldCredential = vault.FindAllByResource(resource).Where(x => x.UserName == key).FirstOrDefault();
|
||||
if (oldCredential != null)
|
||||
try
|
||||
{
|
||||
vault.Remove(oldCredential);
|
||||
var oldCredential = vault.Retrieve(resource, key);
|
||||
if (oldCredential != null)
|
||||
{
|
||||
vault.Remove(oldCredential);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 没有旧值就忽略
|
||||
}
|
||||
|
||||
vault.Add(new PasswordCredential(resource, key, value));
|
||||
@@ -38,13 +45,13 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
public static string? Get(string resource, string key)
|
||||
{
|
||||
var vault = new PasswordVault();
|
||||
var credential = vault.FindAllByResource(resource).Where(x => x.UserName == key).FirstOrDefault();
|
||||
if (credential != null)
|
||||
try
|
||||
{
|
||||
var credential = vault.Retrieve(resource, key);
|
||||
credential.RetrievePassword();
|
||||
return credential.Password;
|
||||
}
|
||||
else
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -56,11 +63,15 @@ namespace BetterLyrics.WinUI3.Helper
|
||||
public static void Delete(string resource, string key)
|
||||
{
|
||||
var vault = new PasswordVault();
|
||||
var credential = vault.FindAllByResource(resource).Where(x => x.UserName == key).FirstOrDefault();
|
||||
if (credential != null)
|
||||
try
|
||||
{
|
||||
var credential = vault.Retrieve(resource, key);
|
||||
vault.Remove(credential);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 不存在就忽略
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,7 +197,7 @@ namespace BetterLyrics.WinUI3.Services.MediaSessionsService
|
||||
return _settingsService.AppSettings.MediaSourceProvidersInfo.FirstOrDefault(s => s.Provider == id)?.IsEnabled ?? true;
|
||||
}
|
||||
|
||||
private bool IsMediaSourceTimelineSyncEnabled(string id)
|
||||
private bool IsMediaSourceTimelineSyncEnabled(string? id)
|
||||
{
|
||||
return _settingsService.AppSettings.MediaSourceProvidersInfo.FirstOrDefault(s => s.Provider == id)?.IsTimelineSyncEnabled ?? true;
|
||||
}
|
||||
@@ -519,7 +519,7 @@ namespace BetterLyrics.WinUI3.Services.MediaSessionsService
|
||||
{
|
||||
_dispatcherQueue.TryEnqueue(DispatcherQueuePriority.Low, async () =>
|
||||
{
|
||||
if (_cachedSongInfo?.PlayerId == Constants.PlayerID.LXMusic)
|
||||
if (PlayerIdMatcher.IsLXMusic(_cachedSongInfo?.PlayerId))
|
||||
{
|
||||
var data = JsonSerializer.Deserialize(e.Message, Serialization.SourceGenerationContext.Default.JsonElement);
|
||||
if (data.ValueKind == JsonValueKind.Number)
|
||||
@@ -533,7 +533,7 @@ namespace BetterLyrics.WinUI3.Services.MediaSessionsService
|
||||
_lxMusicDurationSeconds = data.GetDouble();
|
||||
}
|
||||
|
||||
if (IsMediaSourceTimelineSyncEnabled(Constants.PlayerID.LXMusic))
|
||||
if (IsMediaSourceTimelineSyncEnabled(_cachedSongInfo?.PlayerId))
|
||||
{
|
||||
TimelineChanged?.Invoke(this, new TimelineChangedEventArgs(TimeSpan.FromSeconds(_lxMusicPositionSeconds), TimeSpan.FromSeconds(_lxMusicDurationSeconds)));
|
||||
}
|
||||
@@ -547,7 +547,14 @@ namespace BetterLyrics.WinUI3.Services.MediaSessionsService
|
||||
{
|
||||
_logger.LogInformation("LX Music Album Art URL: {url}", picUrl);
|
||||
_lxMusicAlbumArtBytes = await ImageHelper.GetImageBytesFromUrlAsync(picUrl);
|
||||
_SMTCAlbumArtBuffer = _lxMusicAlbumArtBytes.AsBuffer();
|
||||
if (_lxMusicAlbumArtBytes != null)
|
||||
{
|
||||
_SMTCAlbumArtBuffer = _lxMusicAlbumArtBytes.AsBuffer();
|
||||
}
|
||||
else
|
||||
{
|
||||
_SMTCAlbumArtBuffer = null;
|
||||
}
|
||||
UpdateAlbumArt();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
{
|
||||
var lyricsParser = new LyricsParser();
|
||||
lyricsParser.Parse(
|
||||
AppSettings.MappedSongSearchQueries.ToList(),
|
||||
[MappedSongSearchQuery ?? new()],
|
||||
MappedSongSearchQuery?.OriginalTitle ?? "",
|
||||
MappedSongSearchQuery?.OriginalArtist ?? "",
|
||||
MappedSongSearchQuery?.OriginalAlbum ?? "",
|
||||
|
||||
Reference in New Issue
Block a user