jakewaldron / PlexEmail

This script aggregates all new TV, movie and music releases for the past configured time then optionally writes to your web directory and sends out an email.
206 stars 32 forks source link

Multiple emails #36

Closed morbidpete closed 8 years ago

morbidpete commented 8 years ago

When calling the email script

python /app/plexemail/scripts/plexEmail.py -c /config/config.conf

users including myself are getting 6 copies of said email. Attached my config for reference. Issue does not happen when i disable shared users and set to just myself.

`# This Python file uses the following encoding: utf-8

Folder Paths

plex_data_folder = '/plex' web_folder = '/app/plexemail/web/'

General

date_format = '%m/%d/%y' date_days_back_to_search = 0 date_hours_back_to_search = 24 date_minutes_back_to_search = 0

Plex API Authentication (only used for shared user Emails right now)

plexusername = '*****' plexpassword = '*****'

Image Upload - If this option is enabled, image hosting will be used for web and email

Cloudinary - Sign up for a free account at: http://cloudinary.com/

upload_use_cloudinary = True upload_cloudinary_cloudname = '*****' upload_cloudinary_apikey = '*****_' upload_cloudinary_apisecret = '******'

Web

web_enabled = True

This will not create the index.html file, but will still save the images to the images folder. (Useful for when you only want to send an email)

web_only_save_images = False webdomain = '****._.:8585' web_path = '' web_delete_previous_images = True web_skip_if_no_additions = False

Email

email_enabled = True email_individually = True email_use_bcc = False

['email1@gmail.com', 'email2@hotmail.com']

email_to = ['']

This requires plex_username and plex_password to be filled to get emails of shared users.

email_to_send_to_shared_users = True email_from = 'plex@plasstech.it' email_from_name = 'Plass Plex Server' email_smtpaddress = '***.****.__' email_smtp_port = _ email_use_ssl = False #Port must be an SSL port i.e. 465 emailusername = '*****' emailpassword = '*****'

Only valid if web_enabled = True and upload_use_cloudinary = False

email_use_web_images = False email_skip_if_no_additions = False

Filtering

filter_include_plex_web_link = True filter_show_movies = True filter_show_shows = False filter_show_seasons = False filter_show_episodes = True filter_show_email_images = True

Name of libraries to filter out - ['Home Videos', 'Private']

filter_libraries = []

The sections to include and ordering - tagline, summary, content_rating, duration, year, rating, studio, tags_genre, tags_director, tags_star

filter_sections_movies = { 'tagline':{ 'order':1, 'show': True, 'preText':'', 'postText':'', 'include':[], 'exclude':[] }, 'summary':{ 'order':2, 'show': True, 'preText':'', 'postText':'', 'include':[], 'exclude':[] }, 'tags_genre':{ 'order':3, 'show': True, 'preText':'Genre(s): ', 'postText':'', 'include':[], 'exclude':[] }, 'tags_director':{ 'order':4, 'show': False, 'preText':'Director: ', 'postText':'', 'include':[], 'exclude':[] }, 'tags_star':{ 'order':5, 'show': True, 'preText':'Star(s): ', 'postText':'', 'include':[], 'exclude':[] }, 'content_rating':{ 'order':6, 'show': False, 'preText':'Content Rating: ', 'postText':'', 'include':[], 'exclude':[] }, 'duration':{ 'order':7, 'show': True, 'preText':'Runtime: ', 'postText':' minutes', 'include':[], 'exclude':[] }, 'year':{ 'order':8, 'show': True, 'preText':'Year: ', 'postText':'', 'include':[], 'exclude':[] }, 'studio':{ 'order':9, 'show': False, 'preText':'Studio: ', 'postText':'', 'include':[], 'exclude':[] }, 'rating':{ 'order':10, 'show': True, 'preText':'Rating: ', 'postText':'%', 'include':[], 'exclude':[] } } filter_sections_TV = { 'tagline':{ 'order':1, 'show': True, 'preText':'', 'postText':'', 'include':[], 'exclude':[] }, 'summary':{ 'order':2, 'show': True, 'preText':'', 'postText':'', 'include':[], 'exclude':[] }, 'tags_genre':{ 'order':3, 'show': False, 'preText':'Genre(s): ', 'postText':'', 'include':[], 'exclude':[] }, 'tags_director':{ 'order':4, 'show': False, 'preText':'Director: ', 'postText':'', 'include':[], 'exclude':[] }, 'tags_star':{ 'order':5, 'show': False, 'preText':'Star(s): ', 'postText':'', 'include':[], 'exclude':[] }, 'content_rating':{ 'order':6, 'show': False, 'preText':'Content Rating: ', 'postText':'', 'include':[], 'exclude':[] }, 'duration':{ 'order':7, 'show': True, 'preText':'Runtime: ', 'postText':' minutes', 'include':[], 'exclude':[] }, 'year':{ 'order':8, 'show': False, 'preText':'Year: ', 'postText':'', 'include':[], 'exclude':[] }, 'studio':{ 'order':9, 'show': True, 'preText':'Network: ', 'postText':'', 'include':[], 'exclude':[] }, 'rating':{ 'order':10, 'show': False, 'preText':'Rating: ', 'postText':'%', 'include':[], 'exclude':[] } }

Messages

msg_notice = '' msg_email_teaser = 'Check out this week\'s releases from Plex: {website} - {past_day} - {current_day}' msg_web_title = 'Plass New Plex Releases' msg_email_subject = 'Plass New Plex Releases - {past_day} - {current_day}' msg_header1 = 'Plass New Plex Releases' msg_header2 = '{past_day} - {current_day}' msg_header3 = 'View as Website' msg_top_link = 'What\'s New in Plex' msg_movies_link = 'Movies' msg_shows_link = 'TV Shows' msg_seasons_link = 'TV Seasons' msg_episodes_link = 'TV Episodes' msg_new_movies_header = 'New Movies' msg_new_shows_header = 'New TV Shows' msg_new_seasons_header = 'New TV Seasons' msg_new_episodes_header = 'New TV Episodes' msg_footer = '' msg_no_new_content = 'There have been no new additions to Plex from {past_day} through {current_day}.'

Sorting

Possible values = id, title, title_sort, original_title, rating, tagline,

summary, content_rating, duration, tags_genre, tags_director, tags_star, year,

hash, index, studio

movie_sort_1 = 'rating' movie_sort_1_reverse = True movie_sort_2 = 'title_sort' movie_sort_2_reverse = False movie_sort_3 = '' movie_sort_3_reverse = False

Possible values = id, title, title_sort, original_title, rating, tagline,

summary, content_rating, duration, tags_genre, tags_director, tags_star, year,

hash, index, studio

show_sort_1 = 'title_sort' show_sort_1_reverse = False show_sort_2 = '' show_sort_2_reverse = False show_sort_3 = '' show_sort_3_reverse = False

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_sort_1 = 'title_sort' season_sort_1_reverse = False season_sort_2 = 'index' season_sort_2_reverse = False season_sort_3 = '' season_sort_3_reverse = False

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`

jakewaldron commented 8 years ago

Only thing I can think of is that the list coming back from Plex for shared users has duplicates. I'll add duplicate checking in the next release.

morbidpete commented 8 years ago

Appreciate it 👍🏻

jakewaldron commented 8 years ago

I just added it in the dev branch if you want to give that a try.

morbidpete commented 8 years ago

Away on orders for the next few weeks, I'll give it a go when I get back

morbidpete commented 8 years ago

test script worked well, We will see what happens int he AM when the Cron runs