chore: 统一代码风格
This commit is contained in:
@@ -298,7 +298,7 @@ public static class Database
|
||||
private static readonly HashSet<string> AllowedSortColumns = new(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
"filename", "duration", "sample_rate", "channels",
|
||||
"date_added", "rating", "type", "category", "id"
|
||||
"date_added", "rating", "type", "category", "id",
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
@@ -483,12 +483,12 @@ public static class Database
|
||||
using IDbConnection connection = GetConnection();
|
||||
connection.Open();
|
||||
const string sql = "SELECT keywords FROM audio_files WHERE keywords IS NOT NULL AND keywords != '';";
|
||||
var rows = connection.Query<string>(sql);
|
||||
var allKeywords = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
foreach (var row in rows)
|
||||
IEnumerable<string> rows = connection.Query<string>(sql);
|
||||
HashSet<string> allKeywords = new(StringComparer.OrdinalIgnoreCase);
|
||||
foreach (string row in rows)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(row)) continue;
|
||||
foreach (var part in row.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries))
|
||||
foreach (string part in row.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries))
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(part))
|
||||
allKeywords.Add(part);
|
||||
|
||||
@@ -28,7 +28,7 @@ public static class PreferencesManager
|
||||
// 文件不存在或反序列化失败 → 创建默认实例
|
||||
CurrentPreferences = new Preferences
|
||||
{
|
||||
DatabasePath = GetDefaultDatabasePath()
|
||||
DatabasePath = GetDefaultDatabasePath(),
|
||||
};
|
||||
|
||||
// 立即落盘,确保下次启动能直接读取
|
||||
|
||||
Reference in New Issue
Block a user