PageRenderTime 44ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/net-misc/pytvshows/files/pytvshows-0.2-improved-re.patch

https://bitbucket.org/lmnd/gx86-cropped
Patch | 15 lines | 14 code | 1 blank | 0 comment | 0 complexity | a3771b911999ee645419c147b32286e3 MD5 | raw file
Possible License(s): LGPL-2.1, LGPL-2.0, GPL-3.0, GPL-2.0, LGPL-3.0, MIT, AGPL-3.0, CC-BY-SA-4.0, Apache-2.0, AGPL-1.0, Unlicense, BitTorrent-1.0, BSD-3-Clause, MPL-2.0-no-copyleft-exception, CC-BY-SA-3.0
  1. Improved regular expression for matching season and episode; see
  2. http://sourceforge.net/tracker/index.php?func=detail&aid=2818315&group_id=203642&atid=986413
  3. --- pytvshows.orig 2011-08-17 23:20:16.000000000 +0200
  4. +++ pytvshows 2011-08-17 23:22:30.000000000 +0200
  5. @@ -346,7 +346,8 @@
  6. if self.feedurl:
  7. for episode in self.rss['entries']:
  8. if self.show_type == 'seasonepisode':
  9. - r = re.compile('S([0-9]+)E([0-9]+)')
  10. + #r = re.compile('S([0-9]+)E([0-9]+)')
  11. + r = re.compile(r'\bS?([0-9]{1,2})\s*(?:E|x)?\s*([0-9]{1,2})\b')
  12. match = r.search( episode.title )
  13. season_num = int(match.group(1))
  14. episode_num = int(match.group(2))