Store months for Play by Months graph

Store the selected amount of months in the Graphs > Play Totals > Plays by Months graph in the config.ini file.
This commit is contained in:
Peter Kums 2017-02-27 00:17:56 +01:00
parent b9a22461c1
commit 873f857c82
2 changed files with 4 additions and 2 deletions

View file

@ -174,6 +174,7 @@ _CONFIG_DEFINITIONS = {
'GIT_USER': (str, 'General', 'JonnyWong16'), 'GIT_USER': (str, 'General', 'JonnyWong16'),
'GRAPH_TYPE': (str, 'General', 'plays'), 'GRAPH_TYPE': (str, 'General', 'plays'),
'GRAPH_DAYS': (int, 'General', 30), 'GRAPH_DAYS': (int, 'General', 30),
'GRAPH_MONTHS': (int, 'General', 12),
'GRAPH_TAB': (str, 'General', 'tabs-1'), 'GRAPH_TAB': (str, 'General', 'tabs-1'),
'GROUP_HISTORY_TABLES': (int, 'General', 0), 'GROUP_HISTORY_TABLES': (int, 'General', 0),
'GROWL_ENABLED': (int, 'Growl', 0), 'GROWL_ENABLED': (int, 'Growl', 0),

View file

@ -1747,7 +1747,7 @@ class WebInterface(object):
config = { config = {
"graph_type": plexpy.CONFIG.GRAPH_TYPE, "graph_type": plexpy.CONFIG.GRAPH_TYPE,
"graph_days": plexpy.CONFIG.GRAPH_DAYS, "graph_days": plexpy.CONFIG.GRAPH_DAYS,
"graph_months": 12, "graph_months": plexpy.CONFIG.GRAPH_MONTHS,
"graph_tab": plexpy.CONFIG.GRAPH_TAB, "graph_tab": plexpy.CONFIG.GRAPH_TAB,
"music_logging_enable": plexpy.CONFIG.MUSIC_LOGGING_ENABLE "music_logging_enable": plexpy.CONFIG.MUSIC_LOGGING_ENABLE
} }
@ -1764,7 +1764,8 @@ class WebInterface(object):
plexpy.CONFIG.__setattr__('GRAPH_DAYS', graph_days) plexpy.CONFIG.__setattr__('GRAPH_DAYS', graph_days)
plexpy.CONFIG.write() plexpy.CONFIG.write()
if graph_months: if graph_months:
pass plexpy.CONFIG.__setattr__('GRAPH_MONTHS', graph_months)
plexpy.CONFIG.write()
if graph_tab: if graph_tab:
plexpy.CONFIG.__setattr__('GRAPH_TAB', graph_tab) plexpy.CONFIG.__setattr__('GRAPH_TAB', graph_tab)
plexpy.CONFIG.write() plexpy.CONFIG.write()