Fixes all lowercase issue (#3302)
This commit is contained in:
parent
184c766fa7
commit
b65b78a736
11 changed files with 377 additions and 65 deletions
|
|
@ -72,7 +72,6 @@ public static class GenreHelper
|
|||
public static void UpdateGenreList(ICollection<GenreTagDto>? existingGenres, Series series,
|
||||
IReadOnlyCollection<Genre> newGenres, Action<Genre> handleAdd, Action onModified)
|
||||
{
|
||||
// TODO: Write some unit tests
|
||||
if (existingGenres == null) return;
|
||||
|
||||
var isModified = false;
|
||||
|
|
@ -100,18 +99,17 @@ public static class GenreHelper
|
|||
{
|
||||
var normalizedTitle = tagDto.Title.ToNormalized();
|
||||
|
||||
if (!genreSet.Contains(normalizedTitle)) // This prevents re-adding existing genres
|
||||
if (genreSet.Contains(normalizedTitle)) continue; // This prevents re-adding existing genres
|
||||
|
||||
if (allTagsDict.TryGetValue(normalizedTitle, out var existingTag))
|
||||
{
|
||||
if (allTagsDict.TryGetValue(normalizedTitle, out var existingTag))
|
||||
{
|
||||
handleAdd(existingTag); // Add existing tag from allTagsDict
|
||||
}
|
||||
else
|
||||
{
|
||||
handleAdd(new GenreBuilder(tagDto.Title).Build()); // Add new genre if not found
|
||||
}
|
||||
isModified = true;
|
||||
handleAdd(existingTag); // Add existing tag from allTagsDict
|
||||
}
|
||||
else
|
||||
{
|
||||
handleAdd(new GenreBuilder(tagDto.Title).Build()); // Add new genre if not found
|
||||
}
|
||||
isModified = true;
|
||||
}
|
||||
|
||||
// Call onModified if any changes were made
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue