diff --git a/internal/mirror/current_mirror.go b/internal/mirror/current_mirror.go index e2ef65b..d1cd5f5 100644 --- a/internal/mirror/current_mirror.go +++ b/internal/mirror/current_mirror.go @@ -48,9 +48,9 @@ func (m *CurrentMirror) SearchByTitle(query string) ([]book.Book, error) { page := documentparser.NewCurrentDocumentParser(document) bookResults := page.GetBookDataFromDocument() - // if len(bookResults) >= limit { - // bookResults = bookResults[:limit] - // } + if len(bookResults) >= m.config.numberOfResults { + bookResults = bookResults[:m.config.numberOfResults] + } return bookResults, err } @@ -73,9 +73,9 @@ func (m *CurrentMirror) SearchByAuthor(query string) ([]book.Book, error) { page := documentparser.NewCurrentDocumentParser(document) bookResults := page.GetBookDataFromDocument() - // if len(bookResults) >= limit { - // bookResults = bookResults[:limit] - // } + if len(bookResults) >= m.config.numberOfResults { + bookResults = bookResults[:m.config.numberOfResults] + } return bookResults, err }