Check for library duplicates via lowercase entry title
This commit is contained in:
@@ -38,7 +38,7 @@ export const LibraryDuplicates = () => {
|
|||||||
const duplicatedMangas = useMemo(() => {
|
const duplicatedMangas = useMemo(() => {
|
||||||
const libraryMangas: TManga[] = data?.mangas.nodes ?? [];
|
const libraryMangas: TManga[] = data?.mangas.nodes ?? [];
|
||||||
|
|
||||||
const titleToMangas = Object.groupBy(libraryMangas, ({ title }) => title);
|
const titleToMangas = Object.groupBy(libraryMangas, ({ title }) => title.toLowerCase().trim());
|
||||||
|
|
||||||
return Object.entries(titleToMangas)
|
return Object.entries(titleToMangas)
|
||||||
.filter(([, mangasWithTitle]) => (mangasWithTitle?.length ?? 0) > 1)
|
.filter(([, mangasWithTitle]) => (mangasWithTitle?.length ?? 0) > 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user