Browse files

Remove .nzb from release_name

  • Loading branch information...
1 parent 36e39df commit 86df7b6bda145aea2d11fbbdc9f9ce0a3842dc72 @itofzo itofzo committed Sep 24, 2012
Showing with 11 additions and 2 deletions.
  1. +11 −2 sickbeard/tv.py
View
13 sickbeard/tv.py
@@ -1446,9 +1446,18 @@ def dot(name):
def us(name):
return re.sub('[ -]','_', name)
-
+
+ def release_name(name):
+ if name and name.lower().endswith('.nzb'):
+ name = name.rpartition('.')[0]
+ return name
+
def release_group(name):
+ if not name:
+ return ''
+
np = NameParser(name)
+
try:
parse_result = np.parse(name)
except InvalidNameException, e:
@@ -1475,7 +1484,7 @@ def release_group(name):
'%0S': '%02d' % self.season,
'%E': str(self.episode),
'%0E': '%02d' % self.episode,
- '%RN': self.release_name,
+ '%RN': release_name(self.release_name),
'%RG': release_group(self.release_name),
'%AD': str(self.airdate).replace('-', ' '),
'%A.D': str(self.airdate).replace('-', '.'),

0 comments on commit 86df7b6

Please sign in to comment.