@@ -69,72 +69,83 @@ public Example<DisplayableComic> build() {
6969
7070 ExampleMatcher matcher = ExampleMatcher .matching ();
7171
72- if (coverYear != null ) {
73- log .debug ("Setting cover year filter: {}" , coverYear );
74- detail .setYearPublished (coverYear );
75- matcher = matcher .withMatcher ("coverYear" , ExampleMatcher .GenericPropertyMatchers .exact ());
76- }
77-
78- if (coverMonth != null ) {
79- log .debug ("Setting cover month filter: {}" , coverMonth );
80- detail .setMonthPublished (coverMonth );
81- matcher = matcher .withMatcher ("coverMonth" , ExampleMatcher .GenericPropertyMatchers .exact ());
82- }
83-
84- if (archiveType != null ) {
85- log .debug ("Setting archive type filter: {}" , archiveType );
86- detail .setArchiveType (archiveType );
87- matcher = matcher .withMatcher ("archiveType" , ExampleMatcher .GenericPropertyMatchers .exact ());
88- }
89-
90- if (comicType != null ) {
91- log .debug ("Setting comic type filter: {}" , comicType );
92- detail .setComicType (comicType );
93- matcher = matcher .withMatcher ("comicType" , ExampleMatcher .GenericPropertyMatchers .exact ());
94- }
95-
96- if (comicState != null ) {
97- log .debug ("Setting comic state filter: {}" , comicState );
98- detail .setComicState (comicState );
99- matcher = matcher .withMatcher ("comicState" , ExampleMatcher .GenericPropertyMatchers .exact ());
100- }
101-
102- if (unscrapedState ) {
103- log .debug ("Enabling unscraped filter" );
104- detail .setUnscraped (Boolean .TRUE );
105- matcher = matcher .withMatcher ("unscraped" , ExampleMatcher .GenericPropertyMatchers .exact ());
106- }
107-
108- if (StringUtils .hasLength (publisher )) {
109- log .debug ("Enabling publisher filter" );
110- detail .setPublisher (publisher );
111- matcher = matcher .withMatcher ("publisher" , ExampleMatcher .GenericPropertyMatchers .exact ());
112- }
113-
114- if (StringUtils .hasLength (series )) {
115- log .debug ("Enabling series filter" );
116- detail .setSeries (series );
117- matcher = matcher .withMatcher ("series" , ExampleMatcher .GenericPropertyMatchers .exact ());
118- }
119-
120- if (StringUtils .hasLength (volume )) {
121- log .debug ("Enabling volume filter" );
122- detail .setVolume (volume );
123- matcher = matcher .withMatcher ("volume" , ExampleMatcher .GenericPropertyMatchers .exact ());
124- }
125-
126- if (Objects .nonNull (pageCount ) && pageCount >= 0 ) {
127- log .debug ("Enabling page count filter" );
128- detail .setPageCount (pageCount );
129- matcher = matcher .withMatcher ("pageCount" , ExampleMatcher .GenericPropertyMatchers .exact ());
130- }
131-
13272 if (StringUtils .hasLength (searchText )) {
13373 log .debug ("Returning comics with filter text: {}" , searchText );
74+ detail .setPublisher (searchText );
13475 detail .setSeries (searchText );
76+ detail .setTitle (searchText );
77+ detail .setNotes (searchText );
78+ detail .setDescription (searchText );
13579 matcher =
136- matcher .withMatcher (
137- "series" , ExampleMatcher .GenericPropertyMatchers .ignoreCase ().contains ());
80+ ExampleMatcher .matchingAny ()
81+ .withMatcher (
82+ "publisher" , ExampleMatcher .GenericPropertyMatchers .ignoreCase ().contains ())
83+ .withMatcher ("series" , ExampleMatcher .GenericPropertyMatchers .ignoreCase ().contains ())
84+ .withMatcher ("title" , ExampleMatcher .GenericPropertyMatchers .ignoreCase ().contains ())
85+ .withMatcher ("notes" , ExampleMatcher .GenericPropertyMatchers .ignoreCase ().contains ())
86+ .withMatcher (
87+ "setDescription" , ExampleMatcher .GenericPropertyMatchers .ignoreCase ().contains ());
88+ } else {
89+ if (coverYear != null ) {
90+ log .debug ("Setting cover year filter: {}" , coverYear );
91+ detail .setYearPublished (coverYear );
92+ matcher = matcher .withMatcher ("coverYear" , ExampleMatcher .GenericPropertyMatchers .exact ());
93+ }
94+
95+ if (coverMonth != null ) {
96+ log .debug ("Setting cover month filter: {}" , coverMonth );
97+ detail .setMonthPublished (coverMonth );
98+ matcher = matcher .withMatcher ("coverMonth" , ExampleMatcher .GenericPropertyMatchers .exact ());
99+ }
100+
101+ if (archiveType != null ) {
102+ log .debug ("Setting archive type filter: {}" , archiveType );
103+ detail .setArchiveType (archiveType );
104+ matcher =
105+ matcher .withMatcher ("archiveType" , ExampleMatcher .GenericPropertyMatchers .exact ());
106+ }
107+
108+ if (comicType != null ) {
109+ log .debug ("Setting comic type filter: {}" , comicType );
110+ detail .setComicType (comicType );
111+ matcher = matcher .withMatcher ("comicType" , ExampleMatcher .GenericPropertyMatchers .exact ());
112+ }
113+
114+ if (comicState != null ) {
115+ log .debug ("Setting comic state filter: {}" , comicState );
116+ detail .setComicState (comicState );
117+ matcher = matcher .withMatcher ("comicState" , ExampleMatcher .GenericPropertyMatchers .exact ());
118+ }
119+
120+ if (unscrapedState ) {
121+ log .debug ("Enabling unscraped filter" );
122+ detail .setUnscraped (Boolean .TRUE );
123+ matcher = matcher .withMatcher ("unscraped" , ExampleMatcher .GenericPropertyMatchers .exact ());
124+ }
125+
126+ if (StringUtils .hasLength (publisher )) {
127+ log .debug ("Enabling publisher filter" );
128+ detail .setPublisher (publisher );
129+ matcher = matcher .withMatcher ("publisher" , ExampleMatcher .GenericPropertyMatchers .exact ());
130+ }
131+
132+ if (StringUtils .hasLength (series )) {
133+ log .debug ("Enabling series filter" );
134+ detail .setSeries (series );
135+ matcher = matcher .withMatcher ("series" , ExampleMatcher .GenericPropertyMatchers .exact ());
136+ }
137+
138+ if (StringUtils .hasLength (volume )) {
139+ log .debug ("Enabling volume filter" );
140+ detail .setVolume (volume );
141+ matcher = matcher .withMatcher ("volume" , ExampleMatcher .GenericPropertyMatchers .exact ());
142+ }
143+
144+ if (Objects .nonNull (pageCount ) && pageCount >= 0 ) {
145+ log .debug ("Enabling page count filter" );
146+ detail .setPageCount (pageCount );
147+ matcher = matcher .withMatcher ("pageCount" , ExampleMatcher .GenericPropertyMatchers .exact ());
148+ }
138149 }
139150
140151 return Example .of (detail , matcher );
0 commit comments