Permalink
Browse files

Try to make sense of retarded naming conventions like YYYY.DD.MM

  • Loading branch information...
1 parent 897a1c5 commit 6464e779935215e3c0dcbe557cea5e346ac5af2a @midgetspy committed Oct 14, 2010
Showing with 9 additions and 3 deletions.
  1. +9 −3 tvnamer/utils.py
View
@@ -304,9 +304,15 @@ def parse(self):
"Date-based regex must contain groups 'year', 'month' and 'day'")
match.group('year')
- episodenumbers = [datetime.date(int(match.group('year')),
- int(match.group('month')),
- int(match.group('day')))]
+ month = int(match.group('month'))
+ day = int(match.group('day'))
+
+ if month > 12:
+ tmp_month = month
+ month = day
+ day = tmp_month
+
+ episodenumbers = [datetime.date(int(match.group('year')), month, day)]
else:
raise ConfigValueError(

0 comments on commit 6464e77

Please sign in to comment.