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

running the script gives the following error #34

Open
harroguk opened this issue May 5, 2016 · 3 comments
Open

running the script gives the following error #34

harroguk opened this issue May 5, 2016 · 3 comments

Comments

@harroguk
Copy link

harroguk commented May 5, 2016

Not sure what has changed but trying to run the script gives the following error.

Last email was successfully sent on 25 Apr 2015 (Emails are normally sent weekly on Mondays).

26th April was a Plex Update, I can see no updates to PlexEmail since 4th March 2016

C:\InstalledPrograms\PlexEmail\scripts>python plexEmail.py Traceback (most recent call last): File "plexEmail.py", line 1175, in <module> tvEpisodes = OrderedDict(sorted(tvEpisodes.iteritems(), key=lambda t: t[1][config['episode_sort_2']], reverse=config['episode_sort_2_reverse'])) File "plexEmail.py", line 1175, in <lambda> tvEpisodes = OrderedDict(sorted(tvEpisodes.iteritems(), key=lambda t: t[1][config['episode_sort_2']], reverse=config['episode_sort_2_reverse'])) KeyError: 'season_index'

Line 1175 seems to refer to "episode_sort_2" in the config.conf so here are the relevant lines refering to it in my config.conf

# Possible values = id, title, title_sort, original_title, rating, tagline,
#                   summary, content_rating, duration, tags_genre, tags_director, tags_star, year,
#                   hash, index, studio, season_index, show_title, show_title_sort, show_original_title
episode_sort_1 = 'show_title_sort'
episode_sort_1_reverse = False
episode_sort_2 = 'season_index'
episode_sort_2_reverse = False
episode_sort_3 = 'index'
episode_sort_3_reverse = False
@harroguk
Copy link
Author

harroguk commented May 5, 2016

More details...

Running on Windows Server 2008 R2

PS C:\Windows\System32\WindowsPowerShell\v1.0> python --version
Python 2.7.10
requests-2.7.0
sqlite3.dll - 3.8.8.3

@jakewaldron
Copy link
Owner

I'm not sure what could be causing this. My next major release will include logging throughout the script to hopefully help troubleshoot issues like this.

@harroguk
Copy link
Author

I managed to get it running again by removing 'season_index' and 'index' as sorts so I figure it is bailing out because Plex hasn't populated those fields correctly?

I would be tempted to say you should just sort on show_title in the base script and let people add in their own options for further sorting if they require it just so that you can increase the chances that the script will run out of the box.

As far as I am concerned now, there is no urgent need to fix this, put it to the back of the queue and anyone who searches can see how I fixed it.

My config.conf now reads...

# Possible values = id, title, title_sort, original_title, rating, tagline,
#                   summary, content_rating, duration, tags_genre, tags_director, tags_star, year,
#                   hash, index, studio, season_index, show_title, show_title_sort, show_original_title
episode_sort_1 = 'rating'
episode_sort_1_reverse = False
episode_sort_2 = 'title_sort'
episode_sort_2_reverse = False
episode_sort_3 = 'title_sort'
episode_sort_3_reverse = False

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

No branches or pull requests

2 participants