Skip to content

Commit

Permalink
Removed the Summary field from Comic [#544]
Browse files Browse the repository at this point in the history
The field is redundant with Description, and Description is the
field name used by ComicVine.
  • Loading branch information
mcpierce committed Dec 3, 2020
1 parent 437d148 commit 5137c4c
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public void clear(Comic comic) {
comic.setTitle("");
comic.setDescription("");
comic.setNotes("");
comic.setSummary("");
comic.getStoryArcs().clear();
comic.getTeams().clear();
comic.getCharacters().clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected void loadXmlData(InputStream istream, Comic comic) throws XMLStreamExc
comic.setIssueNumber(xmlInputReader.getElementText());
break;
case "Summary":
comic.setSummary(xmlInputReader.getElementText());
comic.setDescription(xmlInputReader.getElementText());
break;
case "Notes":
comic.setNotes(xmlInputReader.getElementText());
Expand Down Expand Up @@ -185,7 +185,7 @@ public byte[] saveContent(Comic comic) throws IOException {
this.writeEntry(writer, "Volume", comic.getVolume());
this.writeEntry(writer, "Number", comic.getIssueNumber());
this.writeEntry(writer, "Title", comic.getTitle());
this.writeEntry(writer, "Summary", comic.getSummary());
this.writeEntry(writer, "Summary", comic.getDescription());
this.writeEntry(writer, "Notes", comic.getNotes());

if (comic.getCoverDate() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class ComicInfoEntryAdaptorTest extends BaseLoaderTest {
private static final String TEST_VOLUME_NAME = "2011";
private static final String TEST_ISSUE_NUMBER = "24";
private static final String TEST_TITLE = "Test Title";
private static final String TEST_SUMMARY = "Test summary";
private static final String TEST_DESCRIPTION = "Test summary";
private static final String TEST_NOTES = "Test notes";

@InjectMocks ComicInfoEntryAdaptor adaptor;
Expand All @@ -54,7 +54,7 @@ public void setup() {
Mockito.when(comic.getVolume()).thenReturn(TEST_VOLUME_NAME);
Mockito.when(comic.getIssueNumber()).thenReturn(TEST_ISSUE_NUMBER);
Mockito.when(comic.getTitle()).thenReturn(TEST_TITLE);
Mockito.when(comic.getSummary()).thenReturn(TEST_SUMMARY);
Mockito.when(comic.getDescription()).thenReturn(TEST_DESCRIPTION);
Mockito.when(comic.getNotes()).thenReturn(TEST_NOTES);
}

Expand All @@ -68,7 +68,7 @@ public void testLoadComicInfoXmlIgnoreMetadata() throws IOException, EntryLoader
Mockito.verify(comic, Mockito.never()).setVolume(Mockito.anyString());
Mockito.verify(comic, Mockito.never()).setIssueNumber(Mockito.anyString());
Mockito.verify(comic, Mockito.never()).setTitle(Mockito.anyString());
Mockito.verify(comic, Mockito.never()).setSummary(Mockito.anyString());
Mockito.verify(comic, Mockito.never()).setDescription(Mockito.anyString());
Mockito.verify(comic, Mockito.never()).setNotes(Mockito.anyString());
}

Expand All @@ -82,7 +82,7 @@ public void testLoadComicInfoXml() throws IOException, EntryLoaderException {
Mockito.verify(comic, Mockito.times(1)).setVolume(TEST_VOLUME_NAME);
Mockito.verify(comic, Mockito.times(1)).setIssueNumber(TEST_ISSUE_NUMBER);
Mockito.verify(comic, Mockito.times(1)).setTitle(TEST_TITLE);
Mockito.verify(comic, Mockito.times(1)).setSummary(TEST_SUMMARY);
Mockito.verify(comic, Mockito.times(1)).setDescription(TEST_DESCRIPTION);
Mockito.verify(comic, Mockito.times(1)).setNotes(TEST_NOTES);
}

Expand All @@ -97,7 +97,7 @@ public void testSaveComicInfoXml() throws EntryLoaderException, IOException {
Mockito.verify(comic, Mockito.times(1)).getVolume();
Mockito.verify(comic, Mockito.times(1)).getIssueNumber();
Mockito.verify(comic, Mockito.times(1)).getTitle();
Mockito.verify(comic, Mockito.times(1)).getSummary();
Mockito.verify(comic, Mockito.times(1)).getDescription();
Mockito.verify(comic, Mockito.times(1)).getNotes();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,10 @@ public class ComicTest {
private static final String TEST_ISSUE_NUMBER = "23.1";
private static final String TEST_TITLE = "Test title";
private static final Date TEST_DATE = new Date();
private static final String TEST_STORY_ARC_NAME = "First story arc name";
private static final String TEST_COMIC_VINE_ID = "206568";
private static final String TEST_DESCRIPTION = "Simple comic description";
private static final String TEST_SUMMARY = "A test summary of a comic";
private static final String TEST_TEAM = "Super test team";
private static final String TEST_CHARACTER = "Test Man";
private static final String TEST_LOCATION = "Test Location";
private static final String TEST_FILENAME = "src/test/resources/example.cbz";
private static final String TEST_NOTES = "Some sample notes";
private static final String TEST_FILENAME_WITHOUT_EXTENSION = "src/test/resources/example";
private static final String TEST_PAGE_FILENAME = "src/test/resources/example.jpg";
private static final String TEST_BASE_FILENAME = "example.cbz";
private static final String TEST_COMIC_VINE_URL = "http://comicvine.gamespot.com/blah/blah/blah";
Expand Down Expand Up @@ -205,19 +199,6 @@ public void testSeries() {
assertEquals(TEST_SERIES, this.comic.getSeries());
}

@Test
public void testSummary() {
this.comic.setSummary(TEST_SUMMARY);
assertNotNull(this.comic.getSummary());
assertEquals(TEST_SUMMARY, this.comic.getSummary());
}

@Test
public void testSummaryCanBeNull() {
this.comic.setSummary(null);
assertNull(this.comic.getSummary());
}

@Test
public void testTitle() {
this.comic.setTitle(TEST_TITLE);
Expand Down
2 changes: 1 addition & 1 deletion comixed-app/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spring.datasource.url=jdbc:h2:file:~/.comixed/comixed;create=true
spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy
spring.jpa.hibernate.use-new-id-generator-mappings=false
spring.jpa.show-sql=false
spring.jpa.generate-ddl=true
spring.jpa.generate-ddl=false
spring.jpa.hibernate.ddl-auto=none
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true

Expand Down
5 changes: 0 additions & 5 deletions comixed-frontend/src/app/comics/comics.fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ export const COMIC_1: Comic = {
storyArcs: [],
description: 'The description of this comic',
notes: '',
summary: '',
missing: false,
archiveType: 'CBZ',
comicVineId: '',
Expand Down Expand Up @@ -142,7 +141,6 @@ export const COMIC_2: Comic = {
storyArcs: [],
description: 'The description of this comic',
notes: '',
summary: '',
missing: false,
archiveType: 'CBZ',
comicVineId: '',
Expand Down Expand Up @@ -184,7 +182,6 @@ export const COMIC_3: Comic = {
storyArcs: [],
description: 'The description of this comic',
notes: '',
summary: '',
missing: false,
archiveType: 'CBZ',
comicVineId: '',
Expand Down Expand Up @@ -226,7 +223,6 @@ export const COMIC_4: Comic = {
storyArcs: [],
description: 'The description of this comic',
notes: '',
summary: '',
missing: false,
archiveType: 'CBZ',
comicVineId: '',
Expand Down Expand Up @@ -268,7 +264,6 @@ export const COMIC_5: Comic = {
storyArcs: [],
description: 'The description of this comic',
notes: '',
summary: '',
missing: false,
archiveType: 'CBZ',
comicVineId: '',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<div *ngIf='comic'
class='ui-g'>
<div class='ui-g-12 ui-sm-12'>
<p-panel header='{{"comic-story.label.summary"|translate}}'
[toggleable]='true'
[collapsed]='true'>
<div [innerHTML]='comic.summary||"comic-story.text.no-summary"|translate'></div>
</p-panel>
<p-panel header='{{"comic-story.label.description"|translate}}'
[toggleable]='true'
[collapsed]='true'>
Expand Down
1 change: 0 additions & 1 deletion comixed-frontend/src/app/comics/models/comic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export interface Comic {
deletedPageCount: number;
description?: string;
notes?: string;
summary?: string;
comicVineURL?: string;
pages?: Page[];
duplicateCount?: number;
Expand Down
1 change: 0 additions & 1 deletion comixed-frontend/src/assets/i18n/en/comics.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@
},
"comic-story": {
"label": {
"summary": "Summary",
"description": "Description",
"characters": "Characters",
"teams": "Teams",
Expand Down
1 change: 0 additions & 1 deletion comixed-frontend/src/assets/i18n/es/comics.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@
},
"comic-story": {
"label": {
"summary": "Resumen",
"description": "Descripción",
"characters": "Personajes",
"teams": "Equipos",
Expand Down
1 change: 0 additions & 1 deletion comixed-frontend/src/assets/i18n/fr/comics.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@
},
"comic-story": {
"label": {
"summary": "Résumé",
"description": "Description",
"characters": "Personnages",
"teams": "Équipes",
Expand Down
1 change: 0 additions & 1 deletion comixed-frontend/src/assets/i18n/pt/comics.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@
},
"comic-story": {
"label": {
"summary": "Resumo",
"description": "Descrição",
"characters": "Personagens",
"teams": "Equipas",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,6 @@ public class Comic {
@Setter
private String notes;

@Column(name = "summary")
@Lob
@JsonProperty("summary")
@JsonView({View.ComicDetails.class})
@Getter
@Setter
private String summary;

@ElementCollection
@LazyCollection(LazyCollectionOption.FALSE)
@CollectionTable(name = "comic_characters", joinColumns = @JoinColumn(name = "comic_id"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>

<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<changeSet id="007_issue-544_remove_summary_column.xml"
author="mcpierce">

<dropColumn tableName="comics"
columnName="summary"/>

</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
<include file="/db/migrations/0.7.0/004_issue-204_add_task_audit_log.xml"/>
<include file="/db/migrations/0.7.0/005_issue-471_add_exception_field_to_task_audit_log.xml"/>
<include file="/db/migrations/0.7.0/006_issue-474_add_rest_audit_log.xml"/>
<include file="/db/migrations/0.7.0/007_issue-544_remove_summary_column.xml"/>

</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -251,29 +251,6 @@ public void testDescriptionCanBeUpdated() {
assertEquals(description, result.getDescription());
}

@Test
public void testSummaryCanBeNull() {
comic.setSummary(null);

repository.save(comic);

Comic result = repository.findById(comic.getId()).get();

assertNull(result.getSummary());
}

@Test
public void testSummaryCanBeUpdated() {
String summary = comic.getSummary().substring(1);
comic.setSummary(summary);

repository.save(comic);

Comic result = repository.findById(comic.getId()).get();

assertEquals(summary, result.getSummary());
}

@Test
public void testStoryArcs() {
assertEquals(1, comic.getStoryArcs().size());
Expand Down
10 changes: 0 additions & 10 deletions comixed-repositories/src/test/resources/test-database.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
volume="2017"
issue_number="512"
description="This is a comic book's description"
summary="This is a summary"
scan_type_id="1"
format_id="1"
imprint="Marvel Digital"
Expand All @@ -67,7 +66,6 @@
volume="2017"
issue_number="513"
description="This is a comic book's description"
summary="This is a summary"
scan_type_id="2"
format_id="1"/>
<comics ID="1002"
Expand All @@ -81,7 +79,6 @@
volume="2017"
issue_number="512"
description="This is a comic book's description"
summary="This is a summary"
scan_type_id="1"
format_id="1"/>
<comics ID="1003"
Expand All @@ -95,7 +92,6 @@
volume="2017"
issue_number="512"
description="This is a comic book's description"
summary="This is a summary"
scan_type_id="1"
format_id="1"/>
<comics ID="1004"
Expand All @@ -109,7 +105,6 @@
volume="2017"
issue_number="514"
description="This is a comic book's description"
summary="This is a summary"
scan_type_id="2"
format_id="1"/>
<comics ID="1005"
Expand All @@ -123,7 +118,6 @@
volume="2017"
issue_number="250"
description="This is a comic book's description"
summary="This is a summary"
scan_type_id="2"
format_id="1"/>
<comics ID="1006"
Expand All @@ -137,7 +131,6 @@
volume="2017"
issue_number="249"
description="This is a comic book's description"
summary="This is a summary"
scan_type_id="2"
format_id="1"/>
<comics ID="1010"
Expand All @@ -152,7 +145,6 @@
volume="2017"
issue_number="249"
description="This is a comic book's description"
summary="This is a summary"
scan_type_id="2"
format_id="1"/>
<comics ID="1020"
Expand All @@ -167,7 +159,6 @@
volume="2015"
issue_number="19"
description="This is a comic book's description"
summary="This is a summary"
scan_type_id="2"
format_id="1"/>
<comics ID="1021"
Expand All @@ -182,7 +173,6 @@
volume="2015"
issue_number="19"
description="This is a comic book's description"
summary="This is a summary"
scan_type_id="2"
format_id="1"/>
<tasks id="1000"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public OPDSEntry(Comic comic) {
comicContent.append(comic.getTitle());
comicContent.append(" - ");
}
if (StringUtils.isNotEmpty(comic.getSummary())) {
comicContent.append(comic.getSummary());
if (StringUtils.isNotEmpty(comic.getDescription())) {
comicContent.append(comic.getDescription());
}
this.content = new OPDSContent(comicContent.toString());

Expand Down

0 comments on commit 5137c4c

Please sign in to comment.