Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
42ff4a2f62 | ||
![]() |
3fa5f80fc4 | ||
![]() |
9b5b7ef8db | ||
![]() |
560acf62fe | ||
![]() |
27d12922da | ||
![]() |
37b92f3d88 |
@@ -1,5 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v1.2.12 (2015-12-06)
|
||||||
|
|
||||||
|
* Fix for "too many open files" error.
|
||||||
|
|
||||||
|
|
||||||
## v1.2.11 (2015-12-06)
|
## v1.2.11 (2015-12-06)
|
||||||
|
|
||||||
* Fix more regressions (sorry).
|
* Fix more regressions (sorry).
|
||||||
|
@@ -46,6 +46,13 @@ def get_cache_size():
|
|||||||
return 0
|
return 0
|
||||||
return int(plexpy.CONFIG.CACHE_SIZEMB)
|
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):
|
class MonitorDatabase(object):
|
||||||
|
|
||||||
@@ -58,14 +65,7 @@ class MonitorDatabase(object):
|
|||||||
self.connection.execute("PRAGMA journal_mode = %s" % plexpy.CONFIG.JOURNAL_MODE)
|
self.connection.execute("PRAGMA journal_mode = %s" % plexpy.CONFIG.JOURNAL_MODE)
|
||||||
# 64mb of cache memory, probably need to make it user configurable
|
# 64mb of cache memory, probably need to make it user configurable
|
||||||
self.connection.execute("PRAGMA cache_size=-%s" % (get_cache_size() * 1024))
|
self.connection.execute("PRAGMA cache_size=-%s" % (get_cache_size() * 1024))
|
||||||
self.connection.row_factory = self.dict_factory
|
self.connection.row_factory = dict_factory
|
||||||
|
|
||||||
def dict_factory(self, cursor, row):
|
|
||||||
d = {}
|
|
||||||
for idx, col in enumerate(cursor.description):
|
|
||||||
d[col[0]] = row[idx]
|
|
||||||
|
|
||||||
return d
|
|
||||||
|
|
||||||
def action(self, query, args=None, return_last_id=False):
|
def action(self, query, args=None, return_last_id=False):
|
||||||
if query is None:
|
if query is None:
|
||||||
|
@@ -108,9 +108,6 @@ class DataFactory(object):
|
|||||||
# Rename Mystery platform names
|
# Rename Mystery platform names
|
||||||
platform = common.PLATFORM_NAME_OVERRIDES.get(item["platform"], item["platform"])
|
platform = common.PLATFORM_NAME_OVERRIDES.get(item["platform"], item["platform"])
|
||||||
|
|
||||||
# Sanitize player name
|
|
||||||
player = helpers.sanitize(item["player"])
|
|
||||||
|
|
||||||
row = {"reference_id": item["reference_id"],
|
row = {"reference_id": item["reference_id"],
|
||||||
"id": item["id"],
|
"id": item["id"],
|
||||||
"date": item["date"],
|
"date": item["date"],
|
||||||
@@ -122,7 +119,7 @@ class DataFactory(object):
|
|||||||
"user": item["user"],
|
"user": item["user"],
|
||||||
"friendly_name": item["friendly_name"],
|
"friendly_name": item["friendly_name"],
|
||||||
"platform": platform,
|
"platform": platform,
|
||||||
"player": player,
|
"player": item['player'],
|
||||||
"ip_address": item["ip_address"],
|
"ip_address": item["ip_address"],
|
||||||
"media_type": item["media_type"],
|
"media_type": item["media_type"],
|
||||||
"rating_key": item["rating_key"],
|
"rating_key": item["rating_key"],
|
||||||
@@ -575,9 +572,6 @@ class DataFactory(object):
|
|||||||
else:
|
else:
|
||||||
thumb = item['grandparent_thumb']
|
thumb = item['grandparent_thumb']
|
||||||
|
|
||||||
# Sanitize player name
|
|
||||||
player = helpers.sanitize(item["player"])
|
|
||||||
|
|
||||||
row = {'row_id': item['id'],
|
row = {'row_id': item['id'],
|
||||||
'user': item['user'],
|
'user': item['user'],
|
||||||
'friendly_name': item['friendly_name'],
|
'friendly_name': item['friendly_name'],
|
||||||
@@ -588,7 +582,7 @@ class DataFactory(object):
|
|||||||
'thumb': thumb,
|
'thumb': thumb,
|
||||||
'grandparent_thumb': item['grandparent_thumb'],
|
'grandparent_thumb': item['grandparent_thumb'],
|
||||||
'last_watch': item['last_watch'],
|
'last_watch': item['last_watch'],
|
||||||
'player': player,
|
'player': item['player']
|
||||||
}
|
}
|
||||||
last_watched.append(row)
|
last_watched.append(row)
|
||||||
|
|
||||||
|
@@ -89,16 +89,13 @@ class Users(object):
|
|||||||
# Rename Mystery platform names
|
# Rename Mystery platform names
|
||||||
platform = common.PLATFORM_NAME_OVERRIDES.get(item["platform"], item["platform"])
|
platform = common.PLATFORM_NAME_OVERRIDES.get(item["platform"], item["platform"])
|
||||||
|
|
||||||
# Sanitize player name
|
|
||||||
player = helpers.sanitize(item["player"])
|
|
||||||
|
|
||||||
row = {"id": item['id'],
|
row = {"id": item['id'],
|
||||||
"plays": item['plays'],
|
"plays": item['plays'],
|
||||||
"last_seen": item['last_seen'],
|
"last_seen": item['last_seen'],
|
||||||
"friendly_name": item['friendly_name'],
|
"friendly_name": item['friendly_name'],
|
||||||
"ip_address": item['ip_address'],
|
"ip_address": item['ip_address'],
|
||||||
"platform": platform,
|
"platform": platform,
|
||||||
"player": player,
|
"player": item["player"],
|
||||||
"last_watched": item['last_watched'],
|
"last_watched": item['last_watched'],
|
||||||
"thumb": thumb,
|
"thumb": thumb,
|
||||||
"media_type": item['media_type'],
|
"media_type": item['media_type'],
|
||||||
@@ -183,15 +180,12 @@ class Users(object):
|
|||||||
# Rename Mystery platform names
|
# Rename Mystery platform names
|
||||||
platform = common.PLATFORM_NAME_OVERRIDES.get(item["platform"], item["platform"])
|
platform = common.PLATFORM_NAME_OVERRIDES.get(item["platform"], item["platform"])
|
||||||
|
|
||||||
# Sanitize player name
|
|
||||||
player = helpers.sanitize(item["player"])
|
|
||||||
|
|
||||||
row = {"id": item['id'],
|
row = {"id": item['id'],
|
||||||
"last_seen": item['last_seen'],
|
"last_seen": item['last_seen'],
|
||||||
"ip_address": item['ip_address'],
|
"ip_address": item['ip_address'],
|
||||||
"play_count": item['play_count'],
|
"play_count": item['play_count'],
|
||||||
"platform": platform,
|
"platform": platform,
|
||||||
"player": player,
|
"player": item['player'],
|
||||||
"last_watched": item['last_watched'],
|
"last_watched": item['last_watched'],
|
||||||
"thumb": thumb,
|
"thumb": thumb,
|
||||||
"media_type": item['media_type'],
|
"media_type": item['media_type'],
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
PLEXPY_VERSION = "master"
|
PLEXPY_VERSION = "master"
|
||||||
PLEXPY_RELEASE_VERSION = "1.2.11"
|
PLEXPY_RELEASE_VERSION = "1.2.12"
|
||||||
|
@@ -735,8 +735,6 @@ class WebInterface(object):
|
|||||||
if not session['ip_address']:
|
if not session['ip_address']:
|
||||||
ip_address = data_factory.get_session_ip(session['session_key'])
|
ip_address = data_factory.get_session_ip(session['session_key'])
|
||||||
session['ip_address'] = ip_address
|
session['ip_address'] = ip_address
|
||||||
# Sanitize player name
|
|
||||||
session['player'] = helpers.sanitize(session['player'])
|
|
||||||
|
|
||||||
except:
|
except:
|
||||||
return serve_template(templatename="current_activity.html", data=None)
|
return serve_template(templatename="current_activity.html", data=None)
|
||||||
|
Reference in New Issue
Block a user