Kometa-Team/Kometa

TPDb Rate Limit not respected when image is not uploaded

Closed this issue · 2 comments

Version Number

1.21

What branch are you on?

nightly

Describe the Bug

In the current code, the PMM Rate Limiter fro TPDB images is only set as part of the _upload_image def.

This creates a couple problems:

  • On subsequent runs, TPDB is still rate limiting when PMM is doing the validation of the URL, but PMM isn't running the rate limiter to prevent the rate limit on TPDB's side from being reached.
  • If the collection isn't created due to minimum_items not being met, because of the above validation issue, the rate limit is reached on TPDB's side but not PMM's.

In the below example on the pmmtest server, the first run will complete successfully, but the second will have TPDb Rate Limit errors.

Relevant Collection/Overlay/Playlist Definition

templates:
  Movie Collection:
    optional:
      - collection
      - movie
      - trakt_list
    trakt_list: <<trakt_list>>
    tmdb_movie: <<movie>>
    tmdb_collection: <<collection>>
    collection_order: release
    url_poster: https://theposterdb.com/api/assets/<<poster>>
    sort_title: "!00004 <<collection_name>>"
    minimum_items: 1
    delete_below_minimum: true
    move_prefix: "The, A"


collections:
  The 100 Candles Game:
    template: {name: Movie Collection, movie: 530915, poster: 441047}
  100 Girls: 
    template: {name: Movie Collection, movie: 530915, poster: 440270}
  101 Dalmatians (Animated):
    template: {name: Movie Collection, movie: 530915, poster: 163119}
  101 Dalmatians (Live-Action):
    template: {name: Movie Collection, movie: 530915, poster: 163120}
  12 Rounds:
    template: {name: Movie Collection, movie: 530915, poster: 465965}
  2 Days In...:
    template: {name: Movie Collection, movie: 530915, poster: 307758}
  2-Headed Shark Attack:
    template: {name: Movie Collection, movie: 530915, poster: 162223}
  28... Later:
    template: {name: Movie Collection, movie: 530915, poster: 160782}
  3 Men:
    template: {name: Movie Collection, movie: 530915, poster: 163412}
  3 Ninja Kids:
    template: {name: Movie Collection, movie: 530915, poster: 299857}
  30 Days of Night:
    template: {name: Movie Collection, movie: 530915, poster: 160780}
  The 36th Chamber:
    template: {name: Movie Collection, movie: 530915, poster: 160910}
  "300":
    template: {name: Movie Collection, movie: 530915, poster: 162103}
  365 Days:
    template: {name: Movie Collection, movie: 530915, poster: 233228}
  47 Meters Down:
    template: {name: Movie Collection, movie: 530915, poster: 160779}
  47 Ronin:
    template: {name: Movie Collection, movie: 530915, poster: 281419}
  48 Hours:
    template: {name: Movie Collection, movie: 530915, poster: 163457}
  8MM:
    template: {name: Movie Collection, movie: 530915, poster: 163458}
  9 and a half Weeks:
    template: {name: Movie Collection, movie: 530915, poster: 167009}
  967-EVIL:
    template: {name: Movie Collection, movie: 530915, poster: 427192}
  Buddy Games:
    template: {name: Movie Collection, movie: 530915, poster: 383769}

Logs

https://gist.github.com/YozoraXCII/5f82b798b7ff0a2439503d77dfdfbd85

Can confirmed this works as part of nightly3

I just ran a test using the docker version v2.0.0 and I am still running into a LOT of 429 errors. As an interesting side note, any plex item that is related to a 429 error ends up with a "blank" image as the poster in plex. Should I be using a nightly or develop build?

[Update] @YozoraXCII Should I open a bug related to this?