mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Using unicode for name keys now in NameParser cache, resolves 8-byte error.
This commit is contained in:
parent
c577ff2887
commit
89c8ed4372
1 changed files with 4 additions and 2 deletions
|
@ -611,7 +611,8 @@ class NameParserCache:
|
|||
self.npc_cache_size = 200
|
||||
|
||||
def add(self, name, parse_result):
|
||||
name = name.encode('utf-8', 'ignore')
|
||||
if not isinstance(name, unicode):
|
||||
name = unicode(name, 'utf-8', 'replace')
|
||||
|
||||
try:
|
||||
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)
|
||||
|
||||
def get(self, name):
|
||||
name = name.encode('utf-8', 'ignore')
|
||||
if not isinstance(name, unicode):
|
||||
name = unicode(name, 'utf-8', 'replace')
|
||||
|
||||
try:
|
||||
with closing(Shove('sqlite:///' + self.db_name, compress=True)) as npc:
|
||||
|
|
Loading…
Reference in a new issue