Added voice work image fallback. Added tag/creator/circle chip components. Updated voice work search response to include favorite/blacklisted flags for tags/creators/circles.
This commit is contained in:
@@ -376,6 +376,13 @@ public class VoiceWorkSearchProvider(AppDbContext context, IVoiceWorkFullTextSea
|
||||
HasImage = voiceWork.HasImage,
|
||||
Maker = circle.Name,
|
||||
MakerId = circle.MakerId,
|
||||
Circle = new()
|
||||
{
|
||||
Name = circle.Name,
|
||||
MakerId = circle.MakerId,
|
||||
IsFavorite = circle.Favorite,
|
||||
IsBlacklisted = circle.Blacklisted
|
||||
},
|
||||
ExpectedDate = voiceWork.ExpectedDate,
|
||||
SalesDate = voiceWork.SalesDate,
|
||||
PlannedReleaseDate = voiceWork.PlannedReleaseDate,
|
||||
@@ -413,6 +420,13 @@ public class VoiceWorkSearchProvider(AppDbContext context, IVoiceWorkFullTextSea
|
||||
HasImage = voiceWork.HasImage,
|
||||
Maker = circle.Name,
|
||||
MakerId = circle.MakerId,
|
||||
Circle = new()
|
||||
{
|
||||
Name = circle.Name,
|
||||
MakerId = circle.MakerId,
|
||||
IsFavorite = circle.Favorite,
|
||||
IsBlacklisted = circle.Blacklisted
|
||||
},
|
||||
ExpectedDate = voiceWork.ExpectedDate,
|
||||
SalesDate = voiceWork.SalesDate,
|
||||
PlannedReleaseDate = voiceWork.PlannedReleaseDate,
|
||||
@@ -457,14 +471,14 @@ public class VoiceWorkSearchProvider(AppDbContext context, IVoiceWorkFullTextSea
|
||||
from englishTag in et.DefaultIfEmpty()
|
||||
where voiceWorkIds.Contains(voiceWorkTag.VoiceWorkId)
|
||||
orderby voiceWorkTag.VoiceWorkId, voiceWorkTag.Position
|
||||
select new { voiceWorkTag.VoiceWorkId, voiceWorkTag.TagId, tag.Name, EnglishName = englishTag.Name }
|
||||
select new { voiceWorkTag.VoiceWorkId, voiceWorkTag.TagId, tag.Name, EnglishName = englishTag.Name, IsFavorite = tag.Favorite, IsBlacklisted = tag.Blacklisted }
|
||||
).ToListAsync(cancellationToken);
|
||||
|
||||
return tagRows
|
||||
.GroupBy(r => r.VoiceWorkId)
|
||||
.ToDictionary(
|
||||
g => g.Key,
|
||||
g => g.Select(r => new VoiceWorkTagItem { TagId = r.TagId, Name = r.EnglishName ?? r.Name }).ToArray()
|
||||
g => g.Select(r => new VoiceWorkTagItem { TagId = r.TagId, Name = r.EnglishName ?? r.Name, IsFavorite = r.IsFavorite, IsBlacklisted = r.IsBlacklisted }).ToArray()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -475,14 +489,14 @@ public class VoiceWorkSearchProvider(AppDbContext context, IVoiceWorkFullTextSea
|
||||
join creator in context.Creators.AsNoTracking() on voiceWorkCreator.CreatorId equals creator.CreatorId
|
||||
where voiceWorkIds.Contains(voiceWorkCreator.VoiceWorkId)
|
||||
orderby voiceWorkCreator.VoiceWorkId, voiceWorkCreator.Position
|
||||
select new { voiceWorkCreator.VoiceWorkId, creator.CreatorId, creator.Name }
|
||||
select new { voiceWorkCreator.VoiceWorkId, creator.CreatorId, creator.Name, creator.Favorite, creator.Blacklisted }
|
||||
).ToListAsync(cancellationToken);
|
||||
|
||||
return creatorRows
|
||||
.GroupBy(r => r.VoiceWorkId)
|
||||
.ToDictionary(
|
||||
g => g.Key,
|
||||
g => g.Select(r => new VoiceWorkCreatorItem { CreatorId = r.CreatorId, Name = r.Name }).ToArray()
|
||||
g => g.Select(r => new VoiceWorkCreatorItem { CreatorId = r.CreatorId, Name = r.Name, IsFavorite = r.Favorite, IsBlacklisted = r.Blacklisted }).ToArray()
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user