Skip to content

Commit f0ff2c9

Browse files
committed
enable num of results for current mirror
1 parent 611cae0 commit f0ff2c9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

internal/mirror/current_mirror.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ func (m *CurrentMirror) SearchByTitle(query string) ([]book.Book, error) {
4848
page := documentparser.NewCurrentDocumentParser(document)
4949
bookResults := page.GetBookDataFromDocument()
5050

51-
// if len(bookResults) >= limit {
52-
// bookResults = bookResults[:limit]
53-
// }
51+
if len(bookResults) >= m.config.numberOfResults {
52+
bookResults = bookResults[:m.config.numberOfResults]
53+
}
5454

5555
return bookResults, err
5656
}
@@ -73,9 +73,9 @@ func (m *CurrentMirror) SearchByAuthor(query string) ([]book.Book, error) {
7373
page := documentparser.NewCurrentDocumentParser(document)
7474
bookResults := page.GetBookDataFromDocument()
7575

76-
// if len(bookResults) >= limit {
77-
// bookResults = bookResults[:limit]
78-
// }
76+
if len(bookResults) >= m.config.numberOfResults {
77+
bookResults = bookResults[:m.config.numberOfResults]
78+
}
7979

8080
return bookResults, err
8181
}

0 commit comments

Comments
 (0)