comictagger / metron_talker

Metron.cloud comictagger talker plugin
7 stars 3 forks source link

Retrieving all of the issues in a series takes forever #3

Closed lordwelch closed 1 year ago

lordwelch commented 1 year ago

Incorrect use of the cache causes retrieving all issues for a series to be unnecessarily slow. specifically the loop in _fetch_issues_in_series needs to move the call to self._fetch_series out of the loop.

        # Format to expected output
        formatted_series_issues_result = [
            self._map_comic_issue_to_metadata(x, self._fetch_series(series_id)) for x in met_response
        ]

becomes

        series = self._fetch_series(series_id)
        # Format to expected output
        formatted_series_issues_result = [
            self._map_comic_issue_to_metadata(x, series) for x in met_response
        ]
mizaki commented 1 year ago

I copied this from the CV talker and noted it at the time but forgot to follow up. Unless there is a reason I'm missing, I'll port the same change over to CV too?