|
23 | 23 | from email.utils import formataddr |
24 | 24 | from xml.etree.ElementTree import XML |
25 | 25 |
|
| 26 | +SCRIPT_VERSION = 'v0.8.2' |
| 27 | + |
26 | 28 | def replaceConfigTokens(): |
27 | 29 | ## The below code is for backwards compatibility |
28 | 30 | if ('artist_sort_1' not in config.keys() or config['artist_sort_1'] == ""): |
@@ -64,16 +66,16 @@ def replaceConfigTokens(): |
64 | 66 | config['msg_songs_link'] = 'Songs' |
65 | 67 |
|
66 | 68 | if ('filter_show_artists' not in config): |
67 | | - config['filter_show_artists'] = False |
| 69 | + config['filter_show_artists'] = True |
68 | 70 |
|
69 | 71 | if ('filter_show_albums' not in config): |
70 | | - config['filter_show_albums'] = False |
| 72 | + config['filter_show_albums'] = True |
71 | 73 |
|
72 | 74 | if ('filter_show_songs' not in config): |
73 | 75 | config['filter_show_songs'] = False |
74 | 76 |
|
75 | 77 | if ('filter_sections_Music' not in config): |
76 | | - config['filter_sections_Music'] = {'tagline':{'order':1,'show':False,'preText':'<i>','postText':'</i>','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':False,'preText':'Star(s): ','postText':'','include':[],'exclude':[]},'content_rating':{'order':6,'show':False,'preText':'ContentRating: ','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':[]}} |
| 78 | + config['filter_sections_Music'] = {'tagline':{'order':1,'show':False,'preText':'<i>','postText':'</i>','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':False,'preText':'Star(s): ','postText':'','include':[],'exclude':[]},'content_rating':{'order':6,'show':False,'preText':'ContentRating: ','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':[]},'air_date':{'order':11,'show': True,'preText':'Release Date: ','postText':'','include':[],'exclude':[],'format': '%B %d, %Y'},'track_list':{'order':12,'show': True,'headerText':{'trackNumber':'Track#','songName':'Song Name','artistName':'Artist(s)','duration':'Duration'}}} |
77 | 79 |
|
78 | 80 | if ('filter_artists_include' not in config): |
79 | 81 | config['filter_artists_include'] = [] |
@@ -295,7 +297,7 @@ def getSharedUserEmails(): |
295 | 297 | headers = {'Accept': 'application/json', 'X-Plex-Token': token} |
296 | 298 | response = requests.get(url, headers=headers) |
297 | 299 |
|
298 | | - parsed = XML(response.text) |
| 300 | + parsed = XML(response.text.encode('ascii', 'ignore')) |
299 | 301 | for elem in parsed: |
300 | 302 | for name, value in sorted(elem.attrib.items()): |
301 | 303 | if (name == 'email'): |
@@ -767,8 +769,13 @@ def createWebHTML(): |
767 | 769 | parser.add_argument('-c','--configfile', help='The path to a config file to be used in the running of this instance of the script.', default=os.path.dirname(os.path.realpath(sys.argv[0])) + os.path.sep + 'config.conf', required=False) |
768 | 770 | parser.add_argument('-t','--test', help='Run this script in test mode - Sends email only to sender', action='store_true') |
769 | 771 | parser.add_argument('-n','--notice', help='Add a one-time message to the email/web page') |
| 772 | +parser.add_argument('--version', help='Display the version of the script file', action='store_true') |
770 | 773 | args = vars(parser.parse_args()) |
771 | 774 |
|
| 775 | +if ('version' in args): |
| 776 | + print 'Script Version: ' + SCRIPT_VERSION |
| 777 | + sys.exit() |
| 778 | + |
772 | 779 | testMode = False |
773 | 780 |
|
774 | 781 | if ('configfile' in args): |
|
0 commit comments