Kometa-Team / Kometa

Python script to update metadata information for items in plex as well as automatically build collections and playlists. The Wiki Documentation is linked below.
https://kometa.wiki
MIT License
2.43k stars 302 forks source link

Bug: If 1 series fail to be added every single one in bulk add also fails. #693

Closed Drapersniper closed 2 years ago

Drapersniper commented 2 years ago

Describe the Bug

[2022-02-04 17:03:03,589] [util.py:158]               [DEBUG]    | Traceback (most recent call last):                                                                 |
                                                                 |   File "//plex_meta_manager.py", line 733, in run_collection
                                                                 |     radarr_add, sonarr_add = builder.run_missing()
                                                                 |   File "/modules/builder.py", line 1826, in run_missing
                                                                 |     added_to_sonarr += self.library.Sonarr.add_tvdb(missing_tvdb_ids, **self.sonarr_details)
                                                                 |   File "/modules/sonarr.py", line 130, in add_tvdb
                                                                 |     _a, _e, _i = self.api.add_multiple_series(shows, folder, quality_profile, language_profile, monitor,
                                                                 |   File "/usr/local/lib/python3.9/site-packages/arrapi/apis/sonarr.py", line 328, in add_multiple_series
                                                                 |     series.extend([Series(self, data=s) for s in self._raw.post_series_import(json[i:i+per_request])])
                                                                 |   File "/usr/local/lib/python3.9/site-packages/arrapi/raws/sonarr.py", line 26, in post_series_import
                                                                 |     return self._post("series/import", json=json)
                                                                 |   File "/usr/local/lib/python3.9/site-packages/arrapi/raws/base.py", line 40, in _post
                                                                 |     return self._request("post", path, json=json, **kwargs)
                                                                 |   File "/usr/local/lib/python3.9/site-packages/arrapi/raws/base.py", line 83, in _request
                                                                 |     raise ArrException(f"({response.status_code} [{response.reason}]) {response_json[0]['errorMessage']}")
                                                                 | arrapi.exceptions.ArrException: (400 [Bad Request]) Title slug 'duel-masters' is in use by series 'Duel Masters'
                                                                 | 
[2022-02-04 17:03:03,591] [plex_meta_manager.py:789]  [ERROR]    | Unknown Error: (400 [Bad Request]) Title slug 'duel-masters' is in use by series 'Duel Masters'

Relevant Collection Config

Plex Meta Manager Info

Link to logs (required)

In the ideal scenario, the script would catch this error then attempt to iterate through the list instead of bulk so that only the single series fails, I haven't tried it with Radarr to see if it's reproducible but I assume it would be the same issue (the difference with Radarr and sonarr is that sonarr used a title slug based on a series name which is prone to conflict while Radarr uses TMDB ids which will be almost never conflict (only scenario I can think of is if a movie is deleted and the ID is reused)

Just to clarify when this error happens the script carries onto the next collection which means that the collection where this happened fails to be added to Arr/Plex

meisnate12 commented 2 years ago

Update to the newest version and this shouldn't be an issue

Drapersniper commented 2 years ago

Update to the newest version and this shouldn't be an issue

Ah awesome thanks I had the docker imagine pinned for some reason and didn't realise and thought I was on latest.

thanks for the quick reply!