Skip to content

Commit

Permalink
Fixed Jamu unnecessary unicode declarations
Browse files Browse the repository at this point in the history
Removed unnecessary unicode character conversions when data comes from a
jamu.conf file.
  • Loading branch information
rdv authored and wagnerrp committed Aug 20, 2011
1 parent 226ba71 commit bfa8451
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions mythplugins/mythvideo/mythvideo/scripts/jamu.py
Expand Up @@ -302,7 +302,8 @@
# 0.7.2 Fixed a bug where an inetref field was not properly initialized and caused an abort. Ticket #8243
# 0.7.3 Fixed a bug where a user selected TMDB# was not being used.
# Minor change to fuzzy matching of a file named parsed title with those from TMDB and TVDB.
# Added support for unicode characters in a jamu.conf file
# Added support for unicode characters in a jamu.conf file
# Removed unnecessary unicode character conversions when data comes from a jamu.conf file

usage_txt=u'''
JAMU - Just.Another.Metadata.Utility is a versatile utility for downloading graphics and meta data
Expand Down Expand Up @@ -1290,12 +1291,12 @@ def setUseroptions(self, useroptions):
if section == 'regex':
# Change variables per user config file
for option in cfg.options(section):
self.config['name_parse'].append(re.compile(unicode(cfg.get(section, option), 'utf8'), re.UNICODE))
self.config['name_parse'].append(re.compile(cfg.get(section, option), re.UNICODE))
continue
if section == 'ignore-directory':
# Video directories to be excluded from Jamu processing
for option in cfg.options(section):
self.config['ignore-directory'].append(unicode(cfg.get(section, option), 'utf8'))
self.config['ignore-directory'].append(cfg.get(section, option))
continue
if section =='series_name_override':
overrides = {}
Expand Down Expand Up @@ -1775,7 +1776,7 @@ def validate_setVariables(self, args):
else:
if self.config['series_name_override']:
if self.config['series_name_override'].has_key(args[0].lower()):
self.config['sid'] = unicode((self.config['series_name_override'][args[0].lower()]).strip(), 'utf8')
self.config['sid'] = self.config['series_name_override'][args[0].lower()].strip()
else:
self.config['series_name'] = unicode(args[0].strip(), 'utf8')
else:
Expand All @@ -1796,11 +1797,11 @@ def validate_setVariables(self, args):
else:
if self.config['ep_name_massage']:
if self.config['ep_name_massage'].has_key(self.config['series_name']):
tmp_ep_name=args[1].strip()
tmp_ep_name=unicode(args[1].strip(), 'utf8')
tmp_array=self.config['ep_name_massage'][self.config['series_name']]
for pair in tmp_array:
tmp_ep_name = tmp_ep_name.replace(pair[0],pair[1])
self.config['episode_name'] = unicode(tmp_ep_name, 'utf8')
self.config['episode_name'] = tmp_ep_name
else:
self.config['episode_name'] = unicode(args[1].strip(), 'utf8')
else:
Expand Down

0 comments on commit bfa8451

Please sign in to comment.