v1.1.4
This commit is contained in:
@@ -259,7 +259,7 @@ class Graphs(object):
|
||||
dt = datetime.datetime(*month_item[:6])
|
||||
date_string = dt.strftime('%Y-%m')
|
||||
|
||||
categories.append(date_string)
|
||||
categories.append(dt.strftime('%b %Y'))
|
||||
series_1_value = 0
|
||||
series_2_value = 0
|
||||
for item in result:
|
||||
|
@@ -162,6 +162,7 @@ def notify(stream_data=None, notify_action=None):
|
||||
else:
|
||||
logger.debug(u"PlexPy Notifier :: Notify called but incomplete data received.")
|
||||
|
||||
|
||||
def get_notify_state(session):
|
||||
monitor_db = database.MonitorDatabase()
|
||||
result = monitor_db.select('SELECT on_play, on_stop, on_pause, on_resume, on_buffer, on_watched, agent_id '
|
||||
@@ -184,6 +185,7 @@ def get_notify_state(session):
|
||||
|
||||
return notify_states
|
||||
|
||||
|
||||
def set_notify_state(session, state, agent_info):
|
||||
|
||||
if session and state and agent_info:
|
||||
@@ -215,6 +217,7 @@ def set_notify_state(session, state, agent_info):
|
||||
else:
|
||||
logger.error('PlexPy Notifier :: Unable to set notify state.')
|
||||
|
||||
|
||||
def build_notify_text(session, state):
|
||||
from plexpy import pmsconnect, helpers
|
||||
import re
|
||||
@@ -300,7 +303,13 @@ def build_notify_text(session, state):
|
||||
|
||||
duration = helpers.convert_milliseconds_to_minutes(item_metadata['duration'])
|
||||
view_offset = helpers.convert_milliseconds_to_minutes(session['view_offset'])
|
||||
stream_duration = 0 if state == 'play' else int((time.time() - helpers.cast_to_float(session['started']) - helpers.cast_to_float(session['paused_counter'])) / 60)
|
||||
stream_duration = 0
|
||||
if state != 'play':
|
||||
if session['paused_counter']:
|
||||
stream_duration = int((time.time() - helpers.cast_to_float(session['started']) -
|
||||
helpers.cast_to_float(session['paused_counter'])) / 60)
|
||||
else:
|
||||
stream_duration = int((time.time() - helpers.cast_to_float(session['started'])) / 60)
|
||||
|
||||
progress_percent = helpers.get_percent(view_offset, duration)
|
||||
|
||||
@@ -479,6 +488,7 @@ def build_notify_text(session, state):
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def strip_tag(data):
|
||||
import re
|
||||
|
||||
|
@@ -40,7 +40,9 @@ class Users(object):
|
||||
'session_history_metadata.media_type',
|
||||
'session_history.rating_key as rating_key',
|
||||
'session_history_media_info.video_decision',
|
||||
'users.username as user'
|
||||
'users.username as user',
|
||||
'users.do_notify as do_notify',
|
||||
'users.keep_history as keep_history'
|
||||
]
|
||||
try:
|
||||
query = data_tables.ssp_query(table_name='users',
|
||||
@@ -94,7 +96,9 @@ class Users(object):
|
||||
"video_decision": item['video_decision'],
|
||||
"user_thumb": user_thumb,
|
||||
"user": item["user"],
|
||||
"user_id": item['user_id']
|
||||
"user_id": item['user_id'],
|
||||
"do_notify": helpers.checked(item['do_notify']),
|
||||
"keep_history": helpers.checked(item['keep_history'])
|
||||
}
|
||||
|
||||
rows.append(row)
|
||||
|
@@ -1,2 +1,2 @@
|
||||
PLEXPY_VERSION = "master"
|
||||
PLEXPY_RELEASE_VERSION = "1.1.3"
|
||||
PLEXPY_RELEASE_VERSION = "1.1.4"
|
||||
|
@@ -492,18 +492,34 @@ class WebInterface(object):
|
||||
kwargs[plain_config] = kwargs[use_config]
|
||||
del kwargs[use_config]
|
||||
|
||||
# Check if we should refresh our data
|
||||
refresh_users = False
|
||||
reschedule = False
|
||||
|
||||
if 'monitoring_interval' in kwargs and 'refresh_users_interval' in kwargs:
|
||||
if (kwargs['monitoring_interval'] != str(plexpy.CONFIG.MONITORING_INTERVAL)) or \
|
||||
(kwargs['refresh_users_interval'] != str(plexpy.CONFIG.REFRESH_USERS_INTERVAL)):
|
||||
reschedule = True
|
||||
|
||||
if 'pms_ip' in kwargs:
|
||||
if kwargs['pms_ip'] != plexpy.CONFIG.PMS_IP:
|
||||
refresh_users = True
|
||||
|
||||
plexpy.CONFIG.process_kwargs(kwargs)
|
||||
|
||||
# Write the config
|
||||
plexpy.CONFIG.write()
|
||||
|
||||
# Reconfigure scheduler
|
||||
plexpy.initialize_scheduler()
|
||||
|
||||
# Get new server URLs for SSL communications.
|
||||
plextv.get_real_pms_url()
|
||||
|
||||
# Refresh users table. Probably shouldn't do this on every config save, will improve this later.
|
||||
threading.Thread(target=plextv.refresh_users).start()
|
||||
# Reconfigure scheduler if intervals changed
|
||||
if reschedule:
|
||||
plexpy.initialize_scheduler()
|
||||
|
||||
# Refresh users table if our server IP changes.
|
||||
if refresh_users:
|
||||
threading.Thread(target=plextv.refresh_users).start()
|
||||
|
||||
raise cherrypy.HTTPRedirect("settings")
|
||||
|
||||
|
Reference in New Issue
Block a user