Skip to content

Search by catalog number in user's collection: add the simplest implementation #1098

Closed
@php-coder

Description

@php-coder

Here is the simplest implementation that even doesn't introduce new methods:

  • modify SeriesController.searchSeriesByCatalog() method to do the following:
    • after search for series in database (see switch) but right before passing the results to a view (model.addAttribute())
      • if feature is enabled
      • and if checkbox is selected
      • and if a user isn't anonymous
      • iterate over results and filter out the series that a user doesn't have in its collection (use CollectionService.isSeriesInCollection())

Yeah, this is kind of ugly, use extra memory, leads to N+1 query to database but it's fastest approach to implement without adding a lot of code.

This is part of #673

Metadata

Metadata

Assignees

Labels

estimation/30mEstimated time: 30 minuteskind/taskTask that is part of some feature

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions