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(); }