From e0e8c71a8f75efba1aaa721e668bb9daa3851628 Mon Sep 17 00:00:00 2001 From: laundromat Date: Mon, 31 Aug 2015 22:05:52 +0200 Subject: [PATCH] Change game title from " - " to ": " --- parsers/tosec_parser.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/parsers/tosec_parser.py b/parsers/tosec_parser.py index 9d71477..c3a5790 100644 --- a/parsers/tosec_parser.py +++ b/parsers/tosec_parser.py @@ -2,6 +2,7 @@ import re import logging from . import constants +from core.helpers.string_ops import transform_tosec_game_title_to_readable from tosecparser.parsers.offlinelist_no_intro_xml_parser import XMLDatFileParser LOGGER = logging.getLogger(__name__) @@ -18,7 +19,7 @@ def parse(self): game['details'] = TosecNamingConvention(game_element.get('name')) game['tosec_name'] = game_element.get('name') - game['title'] = game['details'].title + game['title'] = transform_tosec_game_title_to_readable(game['details'].title) game['publisher'] = game['details'].publisher year = game['details'].date.split('-')[0] if game['details'].date else None try: @@ -189,6 +190,9 @@ def __init__(self, name): dump_flags = [d[1:-1] for d in re.split(r'(\[.*?\])', dump_part) if d] self.set_dump_flags(dump_flags) + # Remove Rev PRG\d. from title + self.title = re.sub('Rev PRG\d*$', '', self.title) + def set_flags(self, flags): current_flag_index = self.parts.index('publisher') + 1 for flag in flags: