Misc Bugs (#510)
* Don't show bookmark context actionable for books * Fixed an issue where when adding a collection tag, the logic wouldn't assume the tag already existed in DB and would reset it. * After editing a series on library page, ensure we refresh collection tags. * Reload recently added section after changing a series * Moved all Stat logger events to Debug * Refactored scroll logic into a single service to keep the code consistent.
This commit is contained in:
parent
914c6f9349
commit
786fa146fb
13 changed files with 92 additions and 52 deletions
|
|
@ -242,6 +242,7 @@ namespace API.Controllers
|
|||
{
|
||||
var seriesId = updateSeriesMetadataDto.SeriesMetadata.SeriesId;
|
||||
var series = await _unitOfWork.SeriesRepository.GetSeriesByIdAsync(seriesId);
|
||||
var allTags = (await _unitOfWork.CollectionTagRepository.GetAllTagsAsync()).ToList();
|
||||
if (series.Metadata == null)
|
||||
{
|
||||
series.Metadata = DbFactory.SeriesMetadata(updateSeriesMetadataDto.Tags
|
||||
|
|
@ -266,13 +267,13 @@ namespace API.Controllers
|
|||
// At this point, all tags that aren't in dto have been removed.
|
||||
foreach (var tag in updateSeriesMetadataDto.Tags)
|
||||
{
|
||||
var existingTag = series.Metadata.CollectionTags.SingleOrDefault(t => t.Title == tag.Title);
|
||||
var existingTag = allTags.SingleOrDefault(t => t.Title == tag.Title);
|
||||
if (existingTag != null)
|
||||
{
|
||||
// Update existingTag
|
||||
existingTag.Promoted = tag.Promoted;
|
||||
existingTag.Title = tag.Title;
|
||||
existingTag.NormalizedTitle = Parser.Parser.Normalize(tag.Title).ToUpper();
|
||||
if (!series.Metadata.CollectionTags.Any(t => t.Title == tag.Title))
|
||||
{
|
||||
newTags.Add(existingTag);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue