CollinHeist/TitleCardMaker

HELP - Different cards for the same show based on Plex library language

Closed this issue ยท 12 comments

Installation

GitHub - master branch

Describe your Problem

I was wondering if it's possible to have different cards for the same show in different Plex libraries that shares the same media files. Allow me to explain I have 2 libraries and both share the same folders
image
The difference between them is the library language within Plex. TV Shows is in english
image
While Series is in spanish
image
I do this because I have a bunch of little nephews and they don't speak english (yet). So I want to know if it's possible to store 2 cards for the same episode.
This is the card with the main title in english and kanji above it, it's for my library TV Shows which is in english.
image
And I want to do the same for the spanish library, but how would I store both cards within the same folder?
image

Screenshots

No response

Preference File

The only way that comes to my mind is 
1. run the script to genereate `english`cards for the show
2. manually save the cards generated
3. create a different YAML file for the plex library but in spanish
4. run the script to genereate `spanish` cards for the show
This way I will have to manually save the cards in a different folder before they are replaced by the spanish cards.

Series YAML

No response

Debug Log

Am I in the right path or there is actually a possible way to do it that I overlooked within the wiki?

Again I appreciate the great effort you have done!

I've never tested this, but it should be possible.. the problem is keeping both series "live", as the translated title will override the english title on subsequent runs, if you use the same source directory. Did you plan on running both of these at the same time for currently airing series?

I'll test this. @CollinHeist btw I don't understand how to watched_style, unwatched_style work in order to blur unblur pics like u did on the main page of the project. Do I have to run the script everytime I watched something so it 'unblurs' the picture ? or can I keep it run listening for new events?

Well I am asking if you planned on running them together. Beyond that, I added to develop something that should help, if you specify ignore_preferred_titles: true in a Series/Template/library, then the translated titles should be skipped (haven't had a chance to test). That way you can just sync to two separate YAML files, one with a translation (probably in a template), one without, without the need to exit TCM and all that.

[...] Do I have to run the script everytime I watched something so it 'unblurs' the picture ? or can I keep it run listening for new events?

That is done using the Tautulli integration and me watching the episode (so the notification was queued) just before starting recording, so the trigger happened right as I clicked play.

Oh yeah I just noticed it blurs/ unblurs the picture based on the user (admin) watch status for that episode, but it really blurs unblurs for everyone haha I completely forgot this is token based and of course the token belongs to a specific user so i'll skip this part for now. I'll test the spanish config I mentioned before and I'll post my results here

I ran into another issue @CollinHeist

libraries:
  TV Shows:
    path: 'E:\Plex\TV Shows'
    plex_name: TV Shows
    media_server: plex

fonts:
  font_purple:
    color: "rgb(100, 0, 255)"
    size: 110%
  font_red:
    color: "rgb(255, 255, 255)"
    size: 110%    

templates:
  no-sync:
    archive: <<archive>>
    sonarr_sync: false
    tmdb_sync: false
    tmdb_skip_localized_images: false
    sync_specials: false

  anime_with_kanji:
    year: <<year>>
    card_type: anime
    tmdb_sync: true
    library: TV Shows
    episode_data_source: plex
    # library: Anime   # Change to your library name, or delete completely
    translation:
      language: ja
      key: kanji
    extras:
      require_kanji: true

  anime_with_kanji_no_season:
    year: <<year>>
    card_type: anime
    tmdb_sync: true
    library: TV Shows
    episode_data_source: plex
    # watched_style: unique
    # unwatched_style: blur
    # archive_style: blur
    # library: Anime   # Change to your library name, or delete completely
    translation:
      language: ja
      key: kanji
    seasons:
      hide: <<seasonless>>
    defaults:
      seasonless: true
    extras:
      require_kanji: true


series:
  Death's Game (2023):
    name: Death's Game
    episode_data_source: plex
    year: 2023
    library: TV Shows
    card_type: olivier
    # font: font_red
    translation:
    - language: en
      key: preferred_title
    # - language: es
    #   key: spanish_title


  Young Royals (2021):
    name: Young Royals
    episode_data_source: plex
    year: 2021
    library: TV Shows
    card_type: Beedman/GradientLogoTitleCard
    extras:
      logo: 'E:\Plex\TV Shows\Young Royals (2021)\logo.png'

  Mieruko-chan (2021):
    template: anime_with_kanji_no_season

this is my yml file Idk why it's producing Death's Game (2023) - S01E01 - Muerte.png and
image
I cannot make it produce an english card, what am I doing wrong?

this is my preferences.yml

options:
  source: 'E:\Plex\TV Shows'
  series:
  - ./yaml/tvshows.yml
  # - ./yaml/series.yml
  filename_format: "{full_name} - S{season:02}E{episode:02}"
  season_folder_format: "Season {season:02}"
  sync_specials: false
  card_type: standard
  card_extension: png
  card_dimensions: 3200x1800
  episode_data_source: plex
  image_source_priority: plex, tmdb
  filename_format: "{full_name} - S{season:02}E{episode:02} - {title}"
  validate_fonts: false
  season_folder_format: "Season {season:02}"
  .
  .
  .

I commented the ./yaml/series.yml filepath so it's not reading my other config

This is what I was mentioning before: the translated title will override the English title on subsequent runs. The problem is once the translated title has been added to the data file it will always be used. You'd need to have two separate YAML instances, one with the translation and the other with the ignore_preferred_titles: true thing I mentioned

I understand a little more now, I guess I need to update my installation with the content from develop branch ? or can I just add ignore_preferred_titles: true to one of the ymls? Do I need to do a backup of all the config the files ?

Update: I managed to clone the develop branch by git clone -b develop --single-branch https://github.com/CollinHeist/TitleCardMaker.git in a different folder. Setup the environment installed all packages again, I copied back all my ymls and preferences, added ignore_preferred_titles: true under libraries and series, deleted the previous card created Death's Game (2023) - S01E01 - Muerte.png
image
and then run PS C:\Games\Plex\TitleCardMaker-develop> pipenv run python main.py --run
But again it created the same file Death's Game (2023) - S01E01 - Muerte.png I don't know if I missed any step?

this is my tvshows.yml

libraries:
  TV Shows:
    path: 'E:\Plex\TV Shows'
    plex_name: TV Shows
    media_server: plex
    ignore_preferred_titles: true
fonts:
  font_purple:
    color: "rgb(100, 0, 255)"
    size: 110%
  font_red:
    color: "rgb(255, 255, 255)"
    size: 110%    

templates:
  no-sync:
    archive: <<archive>>
    sonarr_sync: false
    tmdb_sync: false
    tmdb_skip_localized_images: false
    sync_specials: false

  anime_with_kanji:
    year: <<year>>
    card_type: anime
    tmdb_sync: true
    library: TV Shows
    episode_data_source: plex
    # library: Anime   # Change to your library name, or delete completely
    translation:
      language: ja
      key: kanji
    extras:
      require_kanji: true

  anime_with_kanji_no_season:
    year: <<year>>
    card_type: anime
    tmdb_sync: true
    library: TV Shows
    episode_data_source: plex
    # watched_style: unique
    # unwatched_style: blur
    # archive_style: blur
    # library: Anime   # Change to your library name, or delete completely
    translation:
      language: ja
      key: kanji
    seasons:
      hide: <<seasonless>>
    defaults:
      seasonless: true
    extras:
      require_kanji: true


series:
  Death's Game (2023):
    name: Death's Game
    episode_data_source: plex
    year: 2023
    library: TV Shows
    card_type: olivier
    # font: font_red
    translation:
    - language: fr
      key: preferred_title
    ignore_preferred_titles: true
    # - language: es
    #   key: spanish_title


  # Young Royals (2021):
  #   name: Young Royals
  #   episode_data_source: plex
  #   year: 2021
  #   library: TV Shows
  #   card_type: Beedman/GradientLogoTitleCard
  #   extras:
  #     logo: 'E:\Plex\TV Shows\Young Royals (2021)\logo.png'

  # Mieruko-chan (2021):
  #   template: anime_with_kanji_no_season

the preferences.yml file hasn't changed because there is nothing else to add there. In the tvshows.yml I even chaged the language: es to language: fr to see if at least it changed to another language different than english or spanish but no luck. The same spanish card is been created. @CollinHeist

@kvalle22 Okay try now, I pushed a fix to develop. I had envisioned something like this:

# preferences.yml
sonarr:
  # ...
  sync:
  - file: /config/tv_english.yml
    add_template: english
  - file: /config/tv_spanish.yml
    add_template: spanish

With your Series YAML files:

# tv_english.yml
templates:
  english:
    ignore_preferred_titles: true
series:
  Example (2024): {library: ..., template: english}
  # ...
# tv_spanish.yml
templates:
  spanish:
    translation:
    - language: es
      key: preferred_title
series:
  Example (2024): {library: ..., template: spanish}
  # ...

@CollinHeist

series:
  Death's Game (2023):
    name: Death's Game
    episode_data_source: plex
    year: 2023
    library: TV Shows
    card_type: olivier
    # font: font_red
    translation:
    - language: fr
      key: preferred_title
    ignore_preferred_titles: true
    # - language: es
    #   key: spanish_title

Result
image

series:
  Death's Game (2023):
    name: Death's Game
    episode_data_source: plex
    year: 2023
    library: TV Shows
    card_type: olivier
    # font: font_red
    translation:
    - language: fr
      key: preferred_title
    ignore_preferred_titles: false
    # - language: es
    #   key: spanish_title

Result
image

Now It works!! at least for me because I will be only switching between es and en, but for someone who wants french and previously executed the script using es it will not work unless I am doing something wrong.

That's correct you can only have one "preferred title" stored per-Episode. To do two alternate non-English titles for separate libraries you'd have to use separate source directories.

Glad it's working!