Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort title tweak #2521

Open
wants to merge 6 commits into
base: nightly
Choose a base branch
from
Open

Sort title tweak #2521

wants to merge 6 commits into from

Conversation

chazlarson
Copy link
Contributor

Description

Removes an unnecessary request to Plex while processing overlays.

Here in overlays.py at line 609:

                    if added_titles:
                        logger.info(f"{len(added_titles)} Items found for {prop_name}")
                        logger.trace(f"Titles Found: {[self.library.get_item_sort_title(a, atr='title') for a in added_titles]}")

added_titles is a list of Plex objects which already contain the sort title. There's no need to hit Plex to ask for it.

Type of Change

  • New feature (non-breaking change which adds functionality)

Checklist

  • Updated the CHANGELOG with the changes

@meisnate12
Copy link
Member

so the issue is with seasons and episodes the titleSort is just the season or episode name which isnt that helpful when looking at the log because you then have to figure out what show it belongs too

@chazlarson
Copy link
Contributor Author

chazlarson commented Feb 21, 2025

so the issue is with seasons and episodes the titleSort is just the season or episode name which isnt that helpful when looking at the log because you then have to figure out what show it belongs too

It looks like this is only used for logging, though. It can be a lot of time dedicated to single throwaway line in the log.

Perhaps a toggle for people who care?

@chazlarson
Copy link
Contributor Author

OK, all this is available without hitting Plex as well:

added_titles[0].titleSort
'All the Way'
self.library.get_item_sort_title(added_titles[0], atr='title')
'Happy Days S01E01'

I'll make the changes.

@chazlarson
Copy link
Contributor Author

Now produces the existing-format names, still without hitting Plex.

| Titles Found: ['Apocalypse Now', 'Cosmic Sin', 'Dungeons & Dragons', 'Flow', 'Hereditary', 'NeverEnding Story III', 'Rollerball', 'Room Next Door', 'Sonic the Hedgehog 3', 'Spider-Man: Into the Spider-Verse'] |
| Titles Found: ['New Amsterdam (2018)']                                                             |
| Titles Found: ['Bloodline Season 1', 'Bloodline Season 2', 'Bloodline Season 3']                   |
| Titles Found: ['Happy Days S01E01', 'Happy Days S01E02', 'Happy Days S01E03', 'Happy Days S01E04', 'Happy Days S01E05', 'Happy Days S01E06', 'Happy Days S01E07', 'Happy Days S01E08', 'Happy Days S01E09', 'Happy Days S01E10', 'Happy Days S01E11', 'Happy Days S01E12', 'Happy Days S01E13', 'Happy Days S01E14', 'Happy Days S01E15', 'Happy Days S01E16'] |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants