Kometa-Team / TMDbAPIs

A lightweight Python library for TMDb V3 and V4 APIs.
https://tmdbapis.metamanager.wiki
MIT License
11 stars 0 forks source link

[Bug]: company with no movies exits with an error rather than producing an empty list #156

Closed chazlarson closed 7 months ago

chazlarson commented 7 months ago

Version Number

tmdbapis==1.2.6

Describe the Bug

A TMDB company with no items should produce an empty list, not die with an error:

| Builder: tmdb_company: 88716                                                                       |
|                                                                                                    |
| Traceback (most recent call last):                                                                 |
|   File "/opt/pmm/Plex-Meta-Manager/plex_meta_manager.py", line 775, in run_collection              |
|     builder.filter_and_save_items(builder.gather_ids(method, value))                               |
|   File "/opt/pmm/Plex-Meta-Manager/modules/builder.py", line 2223, in gather_ids                   |
|     ids = self.config.TMDb.get_tmdb_ids(method, value, self.library.is_movie, self.tmdb_region)    |
|   File "/opt/pmm/Plex-Meta-Manager/modules/tmdb.py", line 340, in get_tmdb_ids                     |
|     ids = [(i.id, result_type) for i in results.get_results(results.total_results)]                |
|   File "/opt/pmm/Plex-Meta-Manager/.direnv/python-3.10.12/lib/python3.10/site-packages/tmdbapis/objs/pagination.py", line 111, in get_results |
|     raise Invalid("amount must be greater then 0")                                                 |
| tmdbapis.exceptions.Invalid: amount must be greater then 0                                         |
|                                                                                                    |
| Unknown Error: amount must be greater then 0                                                       |