diff --git a/comixed-adaptors/src/main/java/org/comixedproject/adaptors/archive/AbstractArchiveAdaptor.java b/comixed-adaptors/src/main/java/org/comixedproject/adaptors/archive/AbstractArchiveAdaptor.java index 9c718e44d..63b060ab2 100644 --- a/comixed-adaptors/src/main/java/org/comixedproject/adaptors/archive/AbstractArchiveAdaptor.java +++ b/comixed-adaptors/src/main/java/org/comixedproject/adaptors/archive/AbstractArchiveAdaptor.java @@ -21,7 +21,7 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; -import java.util.List; +import java.util.*; import lombok.Getter; import lombok.NonNull; import lombok.RequiredArgsConstructor; diff --git a/comixed-model/src/main/java/org/comixedproject/model/comicbooks/Comic.java b/comixed-model/src/main/java/org/comixedproject/model/comicbooks/Comic.java index fdd046897..0ab6259d5 100644 --- a/comixed-model/src/main/java/org/comixedproject/model/comicbooks/Comic.java +++ b/comixed-model/src/main/java/org/comixedproject/model/comicbooks/Comic.java @@ -94,12 +94,6 @@ public class Comic { @Setter private ComicFileDetails fileDetails; - @OneToMany(mappedBy = "comic", cascade = CascadeType.ALL, orphanRemoval = true) - @OrderColumn(name = "FileNumber") - @JsonView({View.ComicDetailsView.class, View.AuditLogEntryDetail.class}) - @Getter - private Set fileEntries = new HashSet<>(); - @Column(name = "ComicState", nullable = false, updatable = true) @Enumerated(EnumType.STRING) @JsonProperty("comicState") diff --git a/comixed-model/src/main/java/org/comixedproject/model/comicbooks/ComicFileEntry.java b/comixed-model/src/main/java/org/comixedproject/model/comicbooks/ComicFileEntry.java deleted file mode 100644 index f46f6906a..000000000 --- a/comixed-model/src/main/java/org/comixedproject/model/comicbooks/ComicFileEntry.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * ComiXed - A digital comic book library management application. - * Copyright (C) 2020, The ComiXed Project - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package org.comixedproject.model.comicbooks; - -import com.fasterxml.jackson.annotation.*; -import java.util.Objects; -import javax.persistence.*; -import lombok.*; -import org.comixedproject.views.View; - -/** - * ComicFileEntry represents a single file within a comic archive. - * - * @author Darryl L. Pierce - */ -@Entity -@Table(name = "ComicFileEntries") -@JsonIdentityInfo(generator = ObjectIdGenerators.UUIDGenerator.class, property = "@id") -@NoArgsConstructor -@RequiredArgsConstructor -public class ComicFileEntry { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Getter - private Long id; - - @ManyToOne - @JoinColumn(name = "ComicId") - @Getter - @Setter - @NonNull - private Comic comic; - - @Column(name = "FileName", nullable = false, length = 1024) - @JsonProperty("fileName") - @JsonView({View.ComicDetailsView.class, View.AuditLogEntryDetail.class}) - @Getter - @Setter - @NonNull - private String fileName; - - @Column(name = "FileSize", nullable = false) - @JsonProperty("fileSize") - @JsonView({View.ComicDetailsView.class, View.AuditLogEntryDetail.class}) - @Getter - @Setter - @NonNull - private Integer fileSize; - - @Column(name = "FileType", nullable = false, length = 256) - @JsonProperty("fileType") - @JsonView({View.ComicDetailsView.class, View.AuditLogEntryDetail.class}) - @Getter - @Setter - @NonNull - private String fileType; - - @Transient @JsonIgnore @Getter @Setter private boolean touched = false; - - @Override - public boolean equals(final Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - final ComicFileEntry that = (ComicFileEntry) o; - return Objects.equals(fileName, that.fileName); - } - - @Override - public int hashCode() { - return Objects.hash(fileName); - } -} diff --git a/comixed-model/src/main/resources/db/migrations/0.11.0/008_1053_remove_comic_file_entries.xml b/comixed-model/src/main/resources/db/migrations/0.11.0/008_1053_remove_comic_file_entries.xml new file mode 100644 index 000000000..7fe1aa536 --- /dev/null +++ b/comixed-model/src/main/resources/db/migrations/0.11.0/008_1053_remove_comic_file_entries.xml @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/comixed-model/src/main/resources/db/migrations/0.11.0/changelog-0.11.0.xml b/comixed-model/src/main/resources/db/migrations/0.11.0/changelog-0.11.0.xml index fdfacab30..9cd1f6eae 100644 --- a/comixed-model/src/main/resources/db/migrations/0.11.0/changelog-0.11.0.xml +++ b/comixed-model/src/main/resources/db/migrations/0.11.0/changelog-0.11.0.xml @@ -13,5 +13,6 @@ + diff --git a/comixed-state/src/main/java/org/comixedproject/state/comicbooks/actions/ComicFileRecreatedAction.java b/comixed-state/src/main/java/org/comixedproject/state/comicbooks/actions/ComicFileRecreatedAction.java index 798e8b40b..ebc026a3e 100644 --- a/comixed-state/src/main/java/org/comixedproject/state/comicbooks/actions/ComicFileRecreatedAction.java +++ b/comixed-state/src/main/java/org/comixedproject/state/comicbooks/actions/ComicFileRecreatedAction.java @@ -42,8 +42,6 @@ public void execute(final StateContext context) { // prepare the comic for reprocessing log.trace("Clearing file details"); comic.setFileDetails(null); - log.trace("Clearing file entries"); - comic.getFileEntries().clear(); log.trace("Clearing pages"); comic.getPages().clear(); log.trace("Turning off file contents loaded flag"); diff --git a/comixed-state/src/main/java/org/comixedproject/state/comicbooks/actions/PrepareComicForProcessingAction.java b/comixed-state/src/main/java/org/comixedproject/state/comicbooks/actions/PrepareComicForProcessingAction.java index 567b0f982..98d7d2d85 100644 --- a/comixed-state/src/main/java/org/comixedproject/state/comicbooks/actions/PrepareComicForProcessingAction.java +++ b/comixed-state/src/main/java/org/comixedproject/state/comicbooks/actions/PrepareComicForProcessingAction.java @@ -39,8 +39,6 @@ public void execute(final StateContext context) { final Comic comic = this.fetchComic(context); log.trace("Clearing file details"); comic.setFileDetails(null); - log.trace("Clearing file entries"); - comic.getFileEntries().clear(); log.trace("Clearing pages"); comic.getPages().clear(); log.trace("Turning off file contents loaded flag"); diff --git a/comixed-state/src/test/java/org/comixedproject/state/comicbooks/actions/ComicFileRecreatedActionTest.java b/comixed-state/src/test/java/org/comixedproject/state/comicbooks/actions/ComicFileRecreatedActionTest.java index c70d53086..cf02f5e8a 100644 --- a/comixed-state/src/test/java/org/comixedproject/state/comicbooks/actions/ComicFileRecreatedActionTest.java +++ b/comixed-state/src/test/java/org/comixedproject/state/comicbooks/actions/ComicFileRecreatedActionTest.java @@ -19,9 +19,7 @@ package org.comixedproject.state.comicbooks.actions; import java.util.List; -import java.util.Set; import org.comixedproject.model.comicbooks.Comic; -import org.comixedproject.model.comicbooks.ComicFileEntry; import org.comixedproject.model.comicbooks.ComicState; import org.comixedproject.model.comicpages.Page; import org.comixedproject.state.comicbooks.ComicEvent; @@ -41,7 +39,6 @@ public class ComicFileRecreatedActionTest { @Mock private StateContext context; @Mock private MessageHeaders messageHeaders; @Mock private Comic comic; - @Mock private Set fileEntrySet; @Mock private List pageList; @Before @@ -53,14 +50,12 @@ public void setUp() { @Test public void testExecute() { - Mockito.when(comic.getFileEntries()).thenReturn(fileEntrySet); Mockito.when(comic.getPages()).thenReturn(pageList); action.execute(context); Mockito.verify(comic, Mockito.times(1)).setRecreating(false); Mockito.verify(comic, Mockito.times(1)).setFileDetails(null); - Mockito.verify(fileEntrySet, Mockito.times(1)).clear(); Mockito.verify(pageList, Mockito.times(1)).clear(); Mockito.verify(comic, Mockito.times(1)).setFileContentsLoaded(false); Mockito.verify(comic, Mockito.times(1)).setBlockedPagesMarked(false); diff --git a/comixed-state/src/test/java/org/comixedproject/state/comicbooks/actions/PrepareComicForProcessingActionTest.java b/comixed-state/src/test/java/org/comixedproject/state/comicbooks/actions/PrepareComicForProcessingActionTest.java index 4b538df15..0c9093a65 100644 --- a/comixed-state/src/test/java/org/comixedproject/state/comicbooks/actions/PrepareComicForProcessingActionTest.java +++ b/comixed-state/src/test/java/org/comixedproject/state/comicbooks/actions/PrepareComicForProcessingActionTest.java @@ -19,9 +19,7 @@ package org.comixedproject.state.comicbooks.actions; import java.util.List; -import java.util.Set; import org.comixedproject.model.comicbooks.Comic; -import org.comixedproject.model.comicbooks.ComicFileEntry; import org.comixedproject.model.comicbooks.ComicState; import org.comixedproject.model.comicpages.Page; import org.comixedproject.state.comicbooks.ComicEvent; @@ -41,7 +39,6 @@ public class PrepareComicForProcessingActionTest { @Mock private StateContext context; @Mock private MessageHeaders messageHeaders; @Mock private Comic comic; - @Mock private Set fileEntrySet; @Mock private List pageList; @Before @@ -53,13 +50,11 @@ public void setUp() { @Test public void testEvaluate() { - Mockito.when(comic.getFileEntries()).thenReturn(fileEntrySet); Mockito.when(comic.getPages()).thenReturn(pageList); action.execute(context); Mockito.verify(comic, Mockito.times(1)).setFileDetails(null); - Mockito.verify(fileEntrySet, Mockito.times(1)).clear(); Mockito.verify(pageList, Mockito.times(1)).clear(); Mockito.verify(comic, Mockito.times(1)).setFileContentsLoaded(false); Mockito.verify(comic, Mockito.times(1)).setBlockedPagesMarked(false); diff --git a/comixed-state/src/test/java/org/comixedproject/state/comicbooks/actions/RecreateComicFileActionTest.java b/comixed-state/src/test/java/org/comixedproject/state/comicbooks/actions/RecreateComicFileActionTest.java index 356115fc7..272518ac9 100644 --- a/comixed-state/src/test/java/org/comixedproject/state/comicbooks/actions/RecreateComicFileActionTest.java +++ b/comixed-state/src/test/java/org/comixedproject/state/comicbooks/actions/RecreateComicFileActionTest.java @@ -18,11 +18,8 @@ package org.comixedproject.state.comicbooks.actions; -import java.util.List; import org.comixedproject.model.comicbooks.Comic; -import org.comixedproject.model.comicbooks.ComicFileEntry; import org.comixedproject.model.comicbooks.ComicState; -import org.comixedproject.model.comicpages.Page; import org.comixedproject.state.comicbooks.ComicEvent; import org.junit.Before; import org.junit.Test; @@ -40,8 +37,6 @@ public class RecreateComicFileActionTest { @Mock private StateContext context; @Mock private MessageHeaders messageHeaders; @Mock private Comic comic; - @Mock private List fileEntryList; - @Mock private List pageList; @Before public void setUp() { diff --git a/comixed-webui/src/app/comic-books/comic-books.fixtures.ts b/comixed-webui/src/app/comic-books/comic-books.fixtures.ts index 1e0c0df95..fb4483aef 100644 --- a/comixed-webui/src/app/comic-books/comic-books.fixtures.ts +++ b/comixed-webui/src/app/comic-books/comic-books.fixtures.ts @@ -100,8 +100,7 @@ export const COMIC_1: Comic = { lastModifiedOn: 0, nextIssueId: null, previousIssueId: null, - fileDetails: FILE_DETAILS_1, - fileEntries: [] + fileDetails: FILE_DETAILS_1 }; export const COMIC_2: Comic = { @@ -138,8 +137,7 @@ export const COMIC_2: Comic = { lastModifiedOn: 0, nextIssueId: null, previousIssueId: null, - fileDetails: FILE_DETAILS_1, - fileEntries: [] + fileDetails: FILE_DETAILS_1 }; export const COMIC_3: Comic = { @@ -176,8 +174,7 @@ export const COMIC_3: Comic = { lastModifiedOn: 0, nextIssueId: null, previousIssueId: null, - fileDetails: FILE_DETAILS_1, - fileEntries: [] + fileDetails: FILE_DETAILS_1 }; export const COMIC_4: Comic = { @@ -214,8 +211,7 @@ export const COMIC_4: Comic = { lastModifiedOn: 0, nextIssueId: null, previousIssueId: null, - fileDetails: FILE_DETAILS_1, - fileEntries: [] + fileDetails: FILE_DETAILS_1 }; export const COMIC_5: Comic = { @@ -252,8 +248,7 @@ export const COMIC_5: Comic = { lastModifiedOn: 0, nextIssueId: null, previousIssueId: null, - fileDetails: FILE_DETAILS_1, - fileEntries: [] + fileDetails: FILE_DETAILS_1 }; export const SCRAPING_VOLUME_1: ScrapingVolume = { diff --git a/comixed-webui/src/app/comic-books/components/comic-overview/comic-overview.component.html b/comixed-webui/src/app/comic-books/components/comic-overview/comic-overview.component.html index d66c80e1f..802036f7a 100644 --- a/comixed-webui/src/app/comic-books/components/comic-overview/comic-overview.component.html +++ b/comixed-webui/src/app/comic-books/components/comic-overview/comic-overview.component.html @@ -111,22 +111,6 @@ - - - {{ "comic-book.label.file-entries" | translate }} - - - - - {{ - "comic-book.text.file-entries" - | translate: { count: comic.fileEntries.length } - }} - - - {{ "comic-book.label.added-date" | translate }} diff --git a/comixed-webui/src/app/comic-books/models/comic-file-entry.ts b/comixed-webui/src/app/comic-books/models/comic-file-entry.ts deleted file mode 100644 index e8500d203..000000000 --- a/comixed-webui/src/app/comic-books/models/comic-file-entry.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * ComiXed - A digital comic book library management application. - * Copyright (C) 2020, The ComiXed Project - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -export interface ComicFileEntry { - fileNumber: number; - fileName: string; - fileSize: number; - fileType: string; -} diff --git a/comixed-webui/src/app/comic-books/models/comic.ts b/comixed-webui/src/app/comic-books/models/comic.ts index 0ff851028..5fd73b875 100644 --- a/comixed-webui/src/app/comic-books/models/comic.ts +++ b/comixed-webui/src/app/comic-books/models/comic.ts @@ -17,7 +17,6 @@ */ import { FileDetails } from '@app/comic-books/models/file-details'; -import { ComicFileEntry } from '@app/comic-books/models/comic-file-entry'; import { ComicCredit } from '@app/comic-books/models/comic-credit'; import { Page } from '@app/comic-books/models/page'; import { ComicBookState } from '@app/comic-books/models/comic-book-state'; @@ -31,7 +30,6 @@ export interface Comic { comicState: ComicBookState; missing: boolean; fileDetails: FileDetails; - fileEntries: ComicFileEntry[]; addedDate: number; deletedDate: number; lastModifiedOn: number; diff --git a/comixed-webui/src/assets/i18n/de/comic-books.json b/comixed-webui/src/assets/i18n/de/comic-books.json index aed76afd0..c3b43c69c 100644 --- a/comixed-webui/src/assets/i18n/de/comic-books.json +++ b/comixed-webui/src/assets/i18n/de/comic-books.json @@ -34,7 +34,6 @@ "credits": "Creative Team ({count})", "description": "Issue Description", "file-details": "Comic File Details", - "file-entries": "File Entries", "filename": "Filename", "filesize": "Filesize", "imprint": "Imprint", @@ -84,7 +83,6 @@ "text": { "comic-changed": "Write metadata to the comic file.", "comicvine-issue-link": "ComicVine Details Page", - "file-entries": "There {count, plural, =1{is one file} other{are # files}} in this archive.", "filesize": "{size, plural, =1{One byte} other{# bytes}}", "no-matching-volumes": "No matching volumes were found...", "state-ADDED": "Unchanged", diff --git a/comixed-webui/src/assets/i18n/en/comic-books.json b/comixed-webui/src/assets/i18n/en/comic-books.json index dbb811969..03037d007 100644 --- a/comixed-webui/src/assets/i18n/en/comic-books.json +++ b/comixed-webui/src/assets/i18n/en/comic-books.json @@ -34,7 +34,6 @@ "credits": "Creative Team ({count})", "description": "Issue Description", "file-details": "Comic File Details", - "file-entries": "File Entries", "filename": "Filename", "filesize": "Filesize", "imprint": "Imprint", @@ -82,7 +81,6 @@ "text": { "comic-changed": "Write metadata to the comic file.", "comicvine-issue-link": "ComicVine Details Page", - "file-entries": "There {count, plural, =1{is one file} other{are # files}} in this archive.", "filesize": "{size, plural, =1{One byte} other{# bytes}}", "no-matching-volumes": "No matching volumes were found...", "state-ADDED": "Unchanged", diff --git a/comixed-webui/src/assets/i18n/es/comic-books.json b/comixed-webui/src/assets/i18n/es/comic-books.json index d334f3276..8d40cdd72 100644 --- a/comixed-webui/src/assets/i18n/es/comic-books.json +++ b/comixed-webui/src/assets/i18n/es/comic-books.json @@ -34,7 +34,6 @@ "credits": "Equipo creativo ({count})", "description": "Descripción de la edición", "file-details": "Detalles del archivo cómico", - "file-entries": "Entradas de archivos", "filename": "Nombre de archivo", "filesize": "Tamaño de archivo", "imprint": "Marca", @@ -82,7 +81,6 @@ "text": { "comic-changed": "Write metadata to the comic file.", "comicvine-issue-link": "ComicVine Details Page", - "file-entries": "Hay {count, plural, =1{is one file} other{are # files}} en este archivo.", "filesize": "{size, plural, =1{One byte} other{# bytes}}", "no-matching-volumes": "No matching volumes were found...", "state-ADDED": "Igual", diff --git a/comixed-webui/src/assets/i18n/fr/comic-books.json b/comixed-webui/src/assets/i18n/fr/comic-books.json index dbcdb911b..fbcdbb450 100644 --- a/comixed-webui/src/assets/i18n/fr/comic-books.json +++ b/comixed-webui/src/assets/i18n/fr/comic-books.json @@ -34,7 +34,6 @@ "credits": "Équipe créative ({count})", "description": "Description de ce numéro", "file-details": "Détails du fichier de la Bande Dessinée", - "file-entries": "Nombre d'éléments", "filename": "Nom du fichier", "filesize": "Taille du fichier", "imprint": "Mentions légales", @@ -82,7 +81,6 @@ "text": { "comic-changed": "Écrire les métadonnées dans le fichier de la bande dessinée.", "comicvine-issue-link": "Page de détails de ComicVine", - "file-entries": "Il y a {count, plural, =1{un fichier} other{# fichiers}} dans cette archive.", "filesize": "{size, plural, =1{Un byte} other{# bytes}}", "no-matching-volumes": "No matching volumes were found...", "state-ADDED": "Non modifié", diff --git a/comixed-webui/src/assets/i18n/pt/comic-books.json b/comixed-webui/src/assets/i18n/pt/comic-books.json index dbb811969..03037d007 100644 --- a/comixed-webui/src/assets/i18n/pt/comic-books.json +++ b/comixed-webui/src/assets/i18n/pt/comic-books.json @@ -34,7 +34,6 @@ "credits": "Creative Team ({count})", "description": "Issue Description", "file-details": "Comic File Details", - "file-entries": "File Entries", "filename": "Filename", "filesize": "Filesize", "imprint": "Imprint", @@ -82,7 +81,6 @@ "text": { "comic-changed": "Write metadata to the comic file.", "comicvine-issue-link": "ComicVine Details Page", - "file-entries": "There {count, plural, =1{is one file} other{are # files}} in this archive.", "filesize": "{size, plural, =1{One byte} other{# bytes}}", "no-matching-volumes": "No matching volumes were found...", "state-ADDED": "Unchanged",