Scanner Performance Improvements (#1774)
* Refactored the Genre code to be faster and used a dictonary to avoid some lookups. May fix the rare foreign constraint issue. * Refactored tag to the same implementation as Genre. Ensure when grabbing tags from ComicInfo, we normalize and throw out duplicates. * Removed an internal "external" field that was planned for Genres and Tags, but now with new plugin architecture, not needed.
This commit is contained in:
parent
48aebfc3c2
commit
8a0a2f0961
18 changed files with 1925 additions and 152 deletions
|
|
@ -115,7 +115,7 @@ public class SeriesService : ISeriesService
|
|||
}
|
||||
|
||||
series.Metadata.CollectionTags ??= new List<CollectionTag>();
|
||||
UpdateRelatedList(updateSeriesMetadataDto.CollectionTags, series, allCollectionTags, (tag) =>
|
||||
UpdateCollectionsList(updateSeriesMetadataDto.CollectionTags, series, allCollectionTags, (tag) =>
|
||||
{
|
||||
series.Metadata.CollectionTags.Add(tag);
|
||||
});
|
||||
|
|
@ -210,7 +210,7 @@ public class SeriesService : ISeriesService
|
|||
}
|
||||
|
||||
|
||||
private static void UpdateRelatedList(ICollection<CollectionTagDto> tags, Series series, IReadOnlyCollection<CollectionTag> allTags,
|
||||
public static void UpdateCollectionsList(ICollection<CollectionTagDto> tags, Series series, IReadOnlyCollection<CollectionTag> allTags,
|
||||
Action<CollectionTag> handleAdd)
|
||||
{
|
||||
// TODO: Move UpdateRelatedList to a helper so we can easily test
|
||||
|
|
@ -278,7 +278,7 @@ public class SeriesService : ISeriesService
|
|||
else
|
||||
{
|
||||
// Add new tag
|
||||
handleAdd(DbFactory.Genre(tagTitle, false));
|
||||
handleAdd(DbFactory.Genre(tagTitle));
|
||||
isModified = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -320,7 +320,7 @@ public class SeriesService : ISeriesService
|
|||
else
|
||||
{
|
||||
// Add new tag
|
||||
handleAdd(DbFactory.Tag(tagTitle, false));
|
||||
handleAdd(DbFactory.Tag(tagTitle));
|
||||
isModified = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue