This commit is contained in:
Unknown
2018-05-19 15:42:28 -03:00
parent 7758c8dd3e
commit 5ad0f99f42
3 changed files with 250 additions and 4 deletions

View File

@@ -140,6 +140,11 @@ def remove_format(string):
#logger.debug('sale de remove: %s' % string)
return string
def normalize(string):
string = string.decode('utf-8')
normal = ''.join((c for c in unicodedata.normalize('NFD', unicode(string)) if unicodedata.category(c) != 'Mn'))
return normal
def simplify(string):
#logger.info()
@@ -148,9 +153,11 @@ def simplify(string):
string = string.replace('-',' ').replace('_',' ')
string = re.sub(r'\d+','', string)
string = string.strip()
string = string.decode('utf-8')
notilde = ''.join((c for c in unicodedata.normalize('NFD', unicode(string)) if unicodedata.category(c) != 'Mn'))
string = notilde.decode()
notilde = normalize(string)
try:
string = notilde.decode()
except:
pass
string = string.lower()
#logger.debug('sale de simplify: %s' % string)
@@ -410,6 +417,15 @@ def title_format(item):
if lang:
item.title = add_languages(item.title, simple_language)
# Para las busquedas por canal
if item.from_channel != '':
from core import channeltools
channel_parameters = channeltools.get_channel_parameters(item.from_channel)
logger.debug(channel_parameters)
item.title = '%s [%s]' % (item.title, channel_parameters['title'])
# Formato para actualizaciones de series en la videoteca sobreescribe los colores anteriores
if item.channel=='videolibrary' and item.context!='':