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.5k stars 306 forks source link

Tv show episode doesn't get an overlay score #2291

Open rafapirotto opened 3 days ago

rafapirotto commented 3 days ago

Version Number

Version: 2.0.2 (Docker: master)

What branch are you on?

master

Describe the Bug

For some reason the last episode of the second season of "Tell me lies" doesn't get an imdb score overlay. I've noticed that the other episodes get updated but this last one has never got a score overlay.

image image

I've checked the imdb page and it has always had a score

Relevant Collection/Overlay/Playlist Definition

libraries:
  Movies:
    reapply_overlays: true
    remove_overlays: false
    collection_files:
    - folder: collections/movies
    - folder: collections/common
    - default: golden
      template_variables:
        use_year_collections: false
        use_best_picture: true
        use_best_director: true
        collection_order: release.desc
    - default: oscars
      template_variables:
        use_year_collections: false
        use_best_picture: true
        use_best_director: true
        collection_order: release.desc
    - default: cannes
      template_variables:
        use_year_collections: false
        collection_order: release.desc
    - default: bafta
      template_variables:
        use_year_collections: false
        collection_order: release.desc
    - default: sundance
      template_variables:
        use_year_collections: false
        collection_order: release.desc
    - default: venice
      template_variables:
        use_year_collections: false
        collection_order: release.desc
    overlay_files:
    - folder: overlays/common
    - default: runtimes
      template_variables:
        vertical_align: bottom
        horizontal_align: center
    - default: ribbon
      template_variables:
        use_imdb: false
        use_rotten: false
        use_metacritic: false
        use_common: false
    - default: ratings
      template_variables:
        rating1: critic
        rating1_image: rt_tomato
        rating2: audience
        rating2_image: rt_popcorn
        rating3: user
        rating3_image: imdb
    operations:
      mass_user_rating_update: imdb
      mass_audience_rating_update: mdb_tomatoesaudience
      mass_critic_rating_update: mdb_tomatoes
      split_duplicates: true
  TV Shows:
    reapply_overlays: true
    remove_overlays: false
    collection_files:
    - folder: collections/common
    - default: golden
      template_variables:
        use_year_collections: false
        use_best_picture: true
        use_best_director: true
        collection_order: release.desc
    - default: emmy
      template_variables:
        use_year_collections: false
        use_best_picture: true
        use_best_director: true
        collection_order: release.desc
    overlay_files:
    - folder: overlays/common
    - default: runtimes
      template_variables:
        builder_level: episode
        vertical_align: top
        horizontal_align: left
    - default: ratings
      template_variables:
        builder_level: episode
        rating3: user
        rating3_image: imdb
        vertical_position: bottom
        horizontal_position: left
        rating3_font_size: 120
    - default: streaming
      template_variables:
        vertical_align: bottom
        horizontal_align: right
    - default: ratings
      template_variables:
        rating3: user
        rating3_image: imdb
        vertical_position: bottom
        horizontal_position: left
    operations:
      mass_user_rating_update: imdb
      mass_episode_user_rating_update: imdb
      split_duplicates: false
settings:
  cache: true
  cache_expiration: 60
  asset_directory: config/assets
  asset_folders: true
  asset_depth: 0
  create_asset_folders: false
  prioritize_assets: false
  dimensional_asset_rename: false
  download_url_assets: false
  show_missing_season_assets: false
  show_missing_episode_assets: false
  show_asset_not_needed: true
  sync_mode: append
  minimum_items: 1
  default_collection_order:
  delete_below_minimum: true
  delete_not_scheduled: false
  run_again_delay: 2
  missing_only_released: false
  only_filter_missing: false
  show_unmanaged: true
  show_unconfigured: true
  show_filtered: false
  show_options: false
  show_missing: true
  show_missing_assets: false
  save_report: false
  tvdb_language: eng
  ignore_ids:
  ignore_imdb_ids:
  item_refresh_delay: 0
  playlist_sync_to_user: all
  playlist_exclude_users:
  playlist_report: false
  verify_ssl: true
  custom_repo:
  check_nightly: false
  run_order:
  - operations
  - metadata
  - collections
  - overlays
  overlay_artwork_filetype: jpg
  overlay_artwork_quality:
plex:
  url: <<PLEX_URLL>>
  token: <<PLEX_TOKENN>>
  timeout: 60
  clean_bundles: false
  empty_trash: false
  optimize: false
  db_cache:
  verify_ssl:
tmdb:
  apikey: <<TMDB_API_KEY>>
  language: en
  cache_expiration: 60
  region:
mdblist:
  apikey: <<MDB_API_KEY>>
  cache_expiration: 60

Logs

https://gist.github.com/rafapirotto/e2b37800001e370a7cf1423224e0416f

YozoraXCII commented 2 days ago

Your log is also saying you should update to 2.1.0

[2024-10-20 17:45:52,187] [kometa.py:273]             [INFO]     |     Version: 2.0.2 (Docker: master)                                                                |
[2024-10-20 17:45:52,356] [kometa.py:275]             [INFO]     |     Newest Version: 2.1.0    
rafapirotto commented 2 days ago

Doing the plex dance fixed the issue. I do however think that the cache issue is worth being investigated. It appears that I'm not the only one with this issue. @antwanchild said yesterday to me in discord that he has had this issue in the past before as well as I have had this issue a couple of times.

antwanchild commented 2 days ago

I had the issue, not related specifically to an episode, but an issue where renaming the cache fixed what i was having issue with

rafapirotto commented 2 days ago

I had the issue, not related specifically to an episode, but an issue where renaming the cache fixed what i was having issue with

The problem with that fix is that renaming the cache forces a new cache to be built which takes way too much time. I don't consider that to be an optimal solution. I rather believe that investigation the cause of the cache issue is worth pursuing.

antwanchild commented 2 days ago

The problem with that fix is that renaming the cache forces a new cache to be built which takes way too much time. I don't consider that to be an optimal solution. I rather believe that investigation the cause of the cache issue is worth pursuing.

This is the reason you were asked for logs of when it was added Kometa and when Kometa updated the rating and stated it applied an overlay when it actually didn't

chazlarson commented 2 days ago

When Kometa applies an overlay, it saves a record of all aspects of the overlay in the cache.

For example:

"1080Presolution100left1515top305105center(0, 0, 0, 153)3000"

On subsequent runs, if that record has not changed, Kometa figures that the current overlay matches the one it's about to apply, so "No Overlay Update Needed"

If you delete the cache, nothing matches so everything gets updated. When you Plex dance, now the item no longer has an overlay, so it gets regenerated and updated.

For some reason, Kometa thought that the thing already had the overlays it was supposed to have.

Perhaps there was some inconsistency, perhaps the "what overlay did I apply" is incomplete [I think only position changes aren't captured for some overlays, for example].

rafapirotto commented 2 days ago

When Kometa applies an overlay, it saves a record of all aspects of the overlay in the cache.

For example:

"1080Presolution100left1515top305105center(0, 0, 0, 153)3000"

On subsequent runs, if that record has not changed, Kometa figures that the current overlay matches the one it's about to apply, so "No Overlay Update Needed"

If you delete the cache, nothing matches so everything gets updated. When you Plex dance, now the item no longer has an overlay, so it gets regenerated and updated.

For some reason, Kometa thought that the thing already had the overlays it was supposed to have.

Perhaps there was some inconsistency, perhaps the "what overlay did I apply" is incomplete [I think only position changes aren't captured for some overlays, for example].

For more background, the episode was added to plex on october the 16th. The problematic episode was the 8th episode of the second season of Tell me Lies I have found old logs in my backups which may help debug this @antwanchild : image

old logs.zip

Hope this helps!

rafapirotto commented 2 days ago

I have more recent logs if those are neede

chazlarson commented 2 days ago

Seems like there's some logic error in there. Once it gets an overlay future changes in the rating don't apply a new overlay.

episode arrives:
| Processing Tell Me Lies S02E08
| No imdb User Rating Found

| Tell Me Lies S02E08
|   Overlay Warning: No <<user_rating>> found
|   Overlays Applied: Overlay File (1) runtime_info, Overlay File (2) Rating3Fresh

11 hours later:
| Processing Tell Me Lies S02E08
| No imdb User Rating Found

| Tell Me Lies S02E08
|   Overlay Warning: No <<user_rating>> found
|   Overlays Applied: Overlay File (1) runtime_info, Overlay File (2) Rating3Fresh

three hours later:
| Processing Tell Me Lies S02E08
| No imdb User Rating Found

LOG ENDS PREMATURELY

9 hours later:
| Processing Tell Me Lies S02E08
| Item Edits:
| Update User Rating (Batched) | 8.8

| Tell Me Lies S02E08
|   Overlay Update Not Needed

12 hours later:
| Processing Tell Me Lies S02E08
| Item Edits:
| Update User Rating (Batched) | 8.8

| Tell Me Lies S02E08
|   Overlay Update Not Needed

12 hours later:
| Processing Tell Me Lies S02E08
| Item Edits:
| Update User Rating (Batched) | 8.9

| Tell Me Lies S02E08
|   Overlay Update Not Needed

12 hours later:
| Processing Tell Me Lies S02E08

| Tell Me Lies S02E08
|   Overlay Update Not Needed

12 hours later:
| Processing Tell Me Lies S02E08
| Item Edits:
| Update User Rating (Batched) | 9.1

| Tell Me Lies S02E08
|   Overlay Update Not Needed
chazlarson commented 2 days ago

What's in overlays/common?

rafapirotto commented 2 days ago

What's in overlays/common?

overlays:
  4K:
    overlay:
      name: 4K
      file: overlays/common/4K.png
    plex_search:
      all:
        resolution: 4K
rafapirotto commented 2 days ago

Seems like there's some logic error in there. Once it gets an overlay future changes in the rating don't apply a new overlay.

So you are confirming this is indeed a bug and that it can be fixed in a future release?

chazlarson commented 2 days ago

I'm just commenting on what I'm seeing in your logs. That's data from your log files. I haven't reproduced it, though those tests are ongoing.

chazlarson commented 2 days ago

It looks like there's an issue going to or from a null rating: https://docs.google.com/document/d/1cexxP_tyINM3oy1yYVkn0hEAjN-Kt94aK78X-GC4YpM/edit?usp=sharing

rafapirotto commented 2 days ago

It looks like there's an issue going to or from a null rating: https://docs.google.com/document/d/1cexxP_tyINM3oy1yYVkn0hEAjN-Kt94aK78X-GC4YpM/edit?usp=sharing

Interesting. So it is looking like an interesting bug. I'm happy to hear that, I thought I was crazy cause it was happening to me and not everyone else

rafapirotto commented 1 day ago

Is there anything else you need from my side? More logs or something? Also, which is the next step for this? Will this be treated as a bug? @chazlarson

chazlarson commented 1 day ago

Nothing else needed here. Future action is dependent on the author reviewing it.

rafapirotto commented 1 day ago

Nothing else needed here. Future action is dependent on the author reviewing it.

Should I tag him?

chazlarson commented 1 day ago

No need, this issue is assigned to him.