From e5b7dd37138ae463085dc4e4080b51f1ac8db1f7 Mon Sep 17 00:00:00 2001 From: jx Date: Wed, 16 Oct 2024 11:30:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9genre=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JxAudio.Web/Jobs/ScanJob.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/JxAudio.Web/Jobs/ScanJob.cs b/JxAudio.Web/Jobs/ScanJob.cs index b30bc09..4186c52 100644 --- a/JxAudio.Web/Jobs/ScanJob.cs +++ b/JxAudio.Web/Jobs/ScanJob.cs @@ -91,14 +91,15 @@ private async Task ScanFiles(IProviderPlugin providerPlugin, string path, Direct } GenreEntity? genre = null; - if (!track.Genre.IsNullOrEmpty()) + var trackGenre = track.Genre; + if (!trackGenre.IsNullOrEmpty()) { - genre = await GenreEntity.Where(x => x.Name == track.Genre).FirstAsync(); + genre = await GenreEntity.Where(x => x.Name == trackGenre).FirstAsync(); if (genre == null) { genre = new GenreEntity() { - Name = track.Genre + Name = trackGenre }; await genre.SaveAsync(); }