midgetspy/Sick-Beard — pull request #578 by jamesstout (2013-02-07 22:59:03+00:00)
Title: intFromRoman helper function - used by parser.py for ep_num

Not sure if you want to go this far. I tested with the dodgy RSS item from nzb.su and manually from 1-10000. Tests passed.

Previously:

````
Feb-08 01:12:11 DEBUG SEARCHQUEUE-RSS-SEARCH :: Adding item from RSS to cache: imagine-nation - UNCHAIN BLADES EXXIV 1080i HDTV MPA1.0 H.264-TrollHD
Feb-08 01:12:11 ERROR SEARCHQUEUE-RSS-SEARCH :: Error while searching nzb.su, skipping: invalid literal for int() with base 10: 'XXIV'
Feb-08 01:12:11 DEBUG SEARCHQUEUE-RSS-SEARCH :: Traceback (most recent call last):
File "/SaturnV/Apps/src/Sick-Beard/sickbeard/search.py", line 157, in searchForNeededEpisodes
curFoundResults = curProvider.searchRSS()
File "/SaturnV/Apps/src/Sick-Beard/sickbeard/providers/generic.py", line 179, in searchRSS
self.cache.updateCache()
File "/SaturnV/Apps/src/Sick-Beard/sickbeard/tvcache.py", line 128, in updateCache
self._parseItem(item)
File "/SaturnV/Apps/src/Sick-Beard/sickbeard/tvcache.py", line 148, in _parseItem
self._addCacheEntry(title, url)
File "/SaturnV/Apps/src/Sick-Beard/sickbeard/tvcache.py", line 191, in _addCacheEntry
parse_result = myParser.parse(curName)
File "/SaturnV/Apps/src/Sick-Beard/sickbeard/name_parser/parser.py", line 207, in parse
file_name_result = self._parse_string(base_file_name)
File "/SaturnV/Apps/src/Sick-Beard/sickbeard/name_parser/parser.py", line 96, in _parse_string
ep_num = self._convert_number(match.group('ep_num'))
File "/SaturnV/Apps/src/Sick-Beard/sickbeard/name_parser/parser.py", line 182, in _convert_number
return int(number)
ValueError: invalid literal for int() with base 10: 'XXIV'
````

After this patch:

````
Feb-08 05:33:39 DEBUG SEARCHQUEUE-RSS-SEARCH :: Adding item from RSS to cache: imagine-nation - UNCHAIN BLADES EXXIV 1080i HDTV MPA1.0 H.264-TrollHD
Feb-08 05:33:39 DEBUG SEARCHQUEUE-RSS-SEARCH :: Checking the cache to see if we already know the tvdb id of imagine-nation - UNCHAIN BLADES
Feb-08 05:33:39 DEBUG SEARCHQUEUE-RSS-SEARCH :: cache.db: SELECT * FROM scene_names WHERE name = ? with args [u'imagine-nation.UNCHAIN.BLADES']
Feb-08 05:33:39 DEBUG SEARCHQUEUE-RSS-SEARCH :: Cache lookup found 0, using that
Feb-08 05:33:39 DEBUG SEARCHQUEUE-RSS-SEARCH :: cache.db: INSERT INTO nzb_su (name, season, episodes, tvrid, tvdbid, url, time, quality) VALUES (?,?,?,?,?,?,?,?) with args [u'imagine-nation - UNCHAIN BLADES EXXIV 1080i HDTV MPA1.0 H.264-TrollHD', 1, '|24|', 0, 0, u'https://nzb.su/getnzb/e2ca8562ba980b8bbdac192fa674c5f4.nzb&i=88477&r=a021d179d7257c9eec4b84NOTMINE', 1360272819, 32768]
````

Thing is, for this particular RSS feed item, it wasn't an ep_num. So, this is overkill for this issue.

Anyway, the helper function is there is you want it.

Thanks
James