Skip to content

Commit

Permalink
修改genre获取方式
Browse files Browse the repository at this point in the history
  • Loading branch information
j4587698 committed Oct 16, 2024
1 parent eee9b7c commit e5b7dd3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions JxAudio.Web/Jobs/ScanJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit e5b7dd3

Please sign in to comment.