Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6265943607 | ||
![]() |
de39f7691c | ||
![]() |
921a219beb | ||
![]() |
b9c95d49a6 | ||
![]() |
fc0be6bce2 | ||
![]() |
8db891cfe6 | ||
![]() |
f6e77cc578 | ||
![]() |
a3782f9150 | ||
![]() |
7546c7ef42 | ||
![]() |
53de8cda30 | ||
![]() |
1fb7473dc5 | ||
![]() |
cc9d09bd54 | ||
![]() |
42ff4a2f62 | ||
![]() |
3fa5f80fc4 | ||
![]() |
9b5b7ef8db | ||
![]() |
560acf62fe | ||
![]() |
27d12922da | ||
![]() |
37b92f3d88 |
16
CHANGELOG.md
16
CHANGELOG.md
@@ -1,5 +1,21 @@
|
||||
# Changelog
|
||||
|
||||
## v1.2.14 (2015-12-07)
|
||||
|
||||
* Fix regression with PlexWatch db importer and buffer warnings.
|
||||
|
||||
|
||||
## v1.2.13 (2015-12-06)
|
||||
|
||||
* Fix match newlines between tags in notification text.
|
||||
* Fix current activity not showing on PMS 0.9.12.
|
||||
|
||||
|
||||
## v1.2.12 (2015-12-06)
|
||||
|
||||
* Fix for "too many open files" error.
|
||||
|
||||
|
||||
## v1.2.11 (2015-12-06)
|
||||
|
||||
* Fix more regressions (sorry).
|
||||
|
@@ -25,7 +25,7 @@ from plexpy import helpers
|
||||
% endif
|
||||
</div>
|
||||
</div>
|
||||
<p class="help-block">${item['description']}</p>
|
||||
<p class="help-block">${item['description'] | n}</p>
|
||||
</div>
|
||||
% elif item['input_type'] == 'button':
|
||||
<div class="form-group">
|
||||
@@ -34,14 +34,14 @@ from plexpy import helpers
|
||||
<input type="${item['input_type']}" class="btn btn-bright" id="${item['name']}" name="${item['name']}" value="${item['value']}">
|
||||
</div>
|
||||
</div>
|
||||
<p class="help-block">${item['description']}</p>
|
||||
<p class="help-block">${item['description'] | n}</p>
|
||||
</div>
|
||||
% elif item['input_type'] == 'checkbox':
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" data-id="${item['name']}" class="checkboxes" value="1" ${helpers.checked(item['value'])}> ${item['label']}
|
||||
</label>
|
||||
<p class="help-block">${item['description']}</p>
|
||||
<p class="help-block">${item['description'] | n}</p>
|
||||
<input type="hidden" id="${item['name']}" name="${item['name']}" value="${item['value']}">
|
||||
</div>
|
||||
% elif item['input_type'] == 'select':
|
||||
@@ -60,7 +60,7 @@ from plexpy import helpers
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<p class="help-block">${item['description']}</p>
|
||||
<p class="help-block">${item['description'] | n}</p>
|
||||
</div>
|
||||
% endif
|
||||
% endfor
|
||||
|
@@ -400,7 +400,7 @@ class ActivityProcessor(object):
|
||||
'WHERE session_key = ?',
|
||||
[session_key])
|
||||
if buffer_count:
|
||||
return buffer_count
|
||||
return buffer_count['buffer_count']
|
||||
|
||||
return 0
|
||||
|
||||
@@ -417,6 +417,6 @@ class ActivityProcessor(object):
|
||||
'WHERE session_key = ?',
|
||||
[session_key])
|
||||
if last_time:
|
||||
return last_time
|
||||
return last_time['buffer_last_triggered']
|
||||
|
||||
return None
|
@@ -46,6 +46,13 @@ def get_cache_size():
|
||||
return 0
|
||||
return int(plexpy.CONFIG.CACHE_SIZEMB)
|
||||
|
||||
def dict_factory(cursor, row):
|
||||
d = {}
|
||||
for idx, col in enumerate(cursor.description):
|
||||
d[col[0]] = row[idx]
|
||||
|
||||
return d
|
||||
|
||||
|
||||
class MonitorDatabase(object):
|
||||
|
||||
@@ -58,14 +65,7 @@ class MonitorDatabase(object):
|
||||
self.connection.execute("PRAGMA journal_mode = %s" % plexpy.CONFIG.JOURNAL_MODE)
|
||||
# 64mb of cache memory, probably need to make it user configurable
|
||||
self.connection.execute("PRAGMA cache_size=-%s" % (get_cache_size() * 1024))
|
||||
self.connection.row_factory = self.dict_factory
|
||||
|
||||
def dict_factory(self, cursor, row):
|
||||
d = {}
|
||||
for idx, col in enumerate(cursor.description):
|
||||
d[col[0]] = row[idx]
|
||||
|
||||
return d
|
||||
self.connection.row_factory = dict_factory
|
||||
|
||||
def action(self, query, args=None, return_last_id=False):
|
||||
if query is None:
|
||||
@@ -111,7 +111,7 @@ class MonitorDatabase(object):
|
||||
|
||||
def select_single(self, query, args=None):
|
||||
|
||||
sql_results = self.action(query, args).fetchone()[0]
|
||||
sql_results = self.action(query, args).fetchone()
|
||||
|
||||
if sql_results is None or sql_results == "":
|
||||
return ""
|
||||
|
@@ -108,9 +108,6 @@ class DataFactory(object):
|
||||
# Rename Mystery platform names
|
||||
platform = common.PLATFORM_NAME_OVERRIDES.get(item["platform"], item["platform"])
|
||||
|
||||
# Sanitize player name
|
||||
player = helpers.sanitize(item["player"])
|
||||
|
||||
row = {"reference_id": item["reference_id"],
|
||||
"id": item["id"],
|
||||
"date": item["date"],
|
||||
@@ -122,7 +119,7 @@ class DataFactory(object):
|
||||
"user": item["user"],
|
||||
"friendly_name": item["friendly_name"],
|
||||
"platform": platform,
|
||||
"player": player,
|
||||
"player": item['player'],
|
||||
"ip_address": item["ip_address"],
|
||||
"media_type": item["media_type"],
|
||||
"rating_key": item["rating_key"],
|
||||
@@ -575,9 +572,6 @@ class DataFactory(object):
|
||||
else:
|
||||
thumb = item['grandparent_thumb']
|
||||
|
||||
# Sanitize player name
|
||||
player = helpers.sanitize(item["player"])
|
||||
|
||||
row = {'row_id': item['id'],
|
||||
'user': item['user'],
|
||||
'friendly_name': item['friendly_name'],
|
||||
@@ -588,7 +582,7 @@ class DataFactory(object):
|
||||
'thumb': thumb,
|
||||
'grandparent_thumb': item['grandparent_thumb'],
|
||||
'last_watch': item['last_watch'],
|
||||
'player': player,
|
||||
'player': item['player']
|
||||
}
|
||||
last_watched.append(row)
|
||||
|
||||
@@ -1052,6 +1046,6 @@ class DataFactory(object):
|
||||
ip_address = 'N/A'
|
||||
|
||||
for item in result:
|
||||
ip_address = item[0]
|
||||
ip_address = item['ip_address']
|
||||
|
||||
return ip_address
|
||||
|
@@ -315,13 +315,13 @@ def build_notify_text(session=None, timeline=None, state=None):
|
||||
# Check for exclusion tags
|
||||
if metadata['media_type'] == 'movie':
|
||||
# Regex pattern to remove the text in the tags we don't want
|
||||
pattern = re.compile('<tv>[^>]+.</tv>|<music>[^>]+.</music>', re.IGNORECASE|re.DOTALL)
|
||||
pattern = re.compile('\n*<tv>[^>]+.</tv>\n*|\n*<music>[^>]+.</music>\n*', re.IGNORECASE|re.DOTALL)
|
||||
elif metadata['media_type'] == 'show' or metadata['media_type'] == 'episode':
|
||||
# Regex pattern to remove the text in the tags we don't want
|
||||
pattern = re.compile('<movie>[^>]+.</movie>|<music>[^>]+.</music>', re.IGNORECASE|re.DOTALL)
|
||||
pattern = re.compile('\n*<movie>[^>]+.</movie>\n*|\n*?<music>[^>]+.</music>\n*', re.IGNORECASE|re.DOTALL)
|
||||
elif metadata['media_type'] == 'artist' or metadata['media_type'] == 'track':
|
||||
# Regex pattern to remove the text in the tags we don't want
|
||||
pattern = re.compile('<tv>[^>]+.</tv>|<movie>[^>]+.</movie>', re.IGNORECASE|re.DOTALL)
|
||||
pattern = re.compile('\n*<tv>[^>]+.</tv>\n*|\n*<movie>[^>]+.</movie>\n*', re.IGNORECASE|re.DOTALL)
|
||||
else:
|
||||
pattern = None
|
||||
|
||||
|
@@ -342,13 +342,13 @@ class PlexTV(object):
|
||||
|
||||
rating_key = clean_uri.rpartition('%2F')[-1]
|
||||
|
||||
sync_details = {"device_name": device_name,
|
||||
"platform": device_platform,
|
||||
"username": device_username,
|
||||
"friendly_name": device_friendly_name,
|
||||
sync_details = {"device_name": helpers.sanitize(device_name),
|
||||
"platform": helpers.sanitize(device_platform),
|
||||
"username": helpers.sanitize(device_username),
|
||||
"friendly_name": helpers.sanitize(device_friendly_name),
|
||||
"user_id": device_user_id,
|
||||
"root_title": sync_root_title,
|
||||
"title": sync_title,
|
||||
"root_title": helpers.sanitize(sync_root_title),
|
||||
"title": helpers.sanitize(sync_title),
|
||||
"metadata_type": sync_metadata_type,
|
||||
"content_type": sync_content_type,
|
||||
"rating_key": rating_key,
|
||||
|
@@ -89,16 +89,13 @@ class Users(object):
|
||||
# Rename Mystery platform names
|
||||
platform = common.PLATFORM_NAME_OVERRIDES.get(item["platform"], item["platform"])
|
||||
|
||||
# Sanitize player name
|
||||
player = helpers.sanitize(item["player"])
|
||||
|
||||
row = {"id": item['id'],
|
||||
"plays": item['plays'],
|
||||
"last_seen": item['last_seen'],
|
||||
"friendly_name": item['friendly_name'],
|
||||
"ip_address": item['ip_address'],
|
||||
"platform": platform,
|
||||
"player": player,
|
||||
"player": item["player"],
|
||||
"last_watched": item['last_watched'],
|
||||
"thumb": thumb,
|
||||
"media_type": item['media_type'],
|
||||
@@ -183,15 +180,12 @@ class Users(object):
|
||||
# Rename Mystery platform names
|
||||
platform = common.PLATFORM_NAME_OVERRIDES.get(item["platform"], item["platform"])
|
||||
|
||||
# Sanitize player name
|
||||
player = helpers.sanitize(item["player"])
|
||||
|
||||
row = {"id": item['id'],
|
||||
"last_seen": item['last_seen'],
|
||||
"ip_address": item['ip_address'],
|
||||
"play_count": item['play_count'],
|
||||
"platform": platform,
|
||||
"player": player,
|
||||
"player": item['player'],
|
||||
"last_watched": item['last_watched'],
|
||||
"thumb": thumb,
|
||||
"media_type": item['media_type'],
|
||||
@@ -325,7 +319,7 @@ class Users(object):
|
||||
query = 'select user_id FROM users WHERE username = ?'
|
||||
result = monitor_db.select_single(query, args=[user])
|
||||
if result:
|
||||
return result
|
||||
return result['user_id']
|
||||
else:
|
||||
return None
|
||||
except:
|
||||
|
@@ -1,2 +1,2 @@
|
||||
PLEXPY_VERSION = "master"
|
||||
PLEXPY_RELEASE_VERSION = "1.2.11"
|
||||
PLEXPY_RELEASE_VERSION = "1.2.14"
|
||||
|
@@ -735,8 +735,6 @@ class WebInterface(object):
|
||||
if not session['ip_address']:
|
||||
ip_address = data_factory.get_session_ip(session['session_key'])
|
||||
session['ip_address'] = ip_address
|
||||
# Sanitize player name
|
||||
session['player'] = helpers.sanitize(session['player'])
|
||||
|
||||
except:
|
||||
return serve_template(templatename="current_activity.html", data=None)
|
||||
|
Reference in New Issue
Block a user