mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 11:32:20 -05:00
Using unicode for name keys now in NameParser cache, resolves 8-byte error.
This commit is contained in:
parent
c577ff2887
commit
89c8ed4372
@ -611,7 +611,8 @@ class NameParserCache:
|
|||||||
self.npc_cache_size = 200
|
self.npc_cache_size = 200
|
||||||
|
|
||||||
def add(self, name, parse_result):
|
def add(self, name, parse_result):
|
||||||
name = name.encode('utf-8', 'ignore')
|
if not isinstance(name, unicode):
|
||||||
|
name = unicode(name, 'utf-8', 'replace')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with closing(Shove('sqlite:///' + self.db_name, compress=True)) as npc:
|
with closing(Shove('sqlite:///' + self.db_name, compress=True)) as npc:
|
||||||
@ -631,7 +632,8 @@ class NameParserCache:
|
|||||||
logger.log(u"NameParser cache error: " + ex(e), logger.ERROR)
|
logger.log(u"NameParser cache error: " + ex(e), logger.ERROR)
|
||||||
|
|
||||||
def get(self, name):
|
def get(self, name):
|
||||||
name = name.encode('utf-8', 'ignore')
|
if not isinstance(name, unicode):
|
||||||
|
name = unicode(name, 'utf-8', 'replace')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with closing(Shove('sqlite:///' + self.db_name, compress=True)) as npc:
|
with closing(Shove('sqlite:///' + self.db_name, compress=True)) as npc:
|
||||||
|
Loading…
Reference in New Issue
Block a user