Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: midgetspy/Sick-Beard
...
head fork: midgetspy/Sick-Beard
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Sep 17, 2012
@itofzo itofzo fix TypeError: season_folders_format = "" 07ee34f
Commits on Sep 18, 2012
@midgetspy Merge pull request #478 from itofzo/fix_TyperError_migrate_v1
fix TypeError: season_folders_format = ""
830b3b1
Showing with 25 additions and 20 deletions.
  1. +25 −20 sickbeard/config.py
View
45 sickbeard/config.py
@@ -283,46 +283,51 @@ def _migrate_v1(self):
"""
Reads in the old naming settings from your config and generates a new config template from them.
"""
-
+
sickbeard.NAMING_PATTERN = self._name_to_pattern()
- logger.log("Based on your old settings I'm setting your new naming pattern to: "+sickbeard.NAMING_PATTERN)
-
+ logger.log("Based on your old settings I'm setting your new naming pattern to: " + sickbeard.NAMING_PATTERN)
+
sickbeard.NAMING_CUSTOM_ABD = bool(check_setting_int(self.config_obj, 'General', 'naming_dates', 0))
-
+
if sickbeard.NAMING_CUSTOM_ABD:
sickbeard.NAMING_ABD_PATTERN = self._name_to_pattern(True)
- logger.log("Adding a custom air-by-date naming pattern to your config: "+sickbeard.NAMING_ABD_PATTERN)
+ logger.log("Adding a custom air-by-date naming pattern to your config: " + sickbeard.NAMING_ABD_PATTERN)
else:
sickbeard.NAMING_ABD_PATTERN = naming.name_abd_presets[0]
-
+
sickbeard.NAMING_MULTI_EP = int(check_setting_int(self.config_obj, 'General', 'naming_multi_ep_type', 1))
-
+
# see if any of their shows used season folders
myDB = db.DBConnection()
season_folder_shows = myDB.select("SELECT * FROM tv_shows WHERE flatten_folders = 0")
-
+
# if any shows had season folders on then prepend season folder to the pattern
if season_folder_shows:
-
+
old_season_format = check_setting_str(self.config_obj, 'General', 'season_folders_format', 'Season %02d')
-
- new_season_format = old_season_format % 9
- new_season_format = new_season_format.replace('09', '%0S')
- new_season_format = new_season_format.replace('9', '%S')
- logger.log(u"Changed season folder format from "+old_season_format+" to "+new_season_format+", prepending it to your naming config")
-
- sickbeard.NAMING_PATTERN = new_season_format + os.sep + sickbeard.NAMING_PATTERN
-
+
+ if old_season_format:
+ try:
+ new_season_format = old_season_format % 9
+ new_season_format = new_season_format.replace('09', '%0S')
+ new_season_format = new_season_format.replace('9', '%S')
+
+ logger.log(u"Changed season folder format from " + old_season_format + " to " + new_season_format + ", prepending it to your naming config")
+ sickbeard.NAMING_PATTERN = new_season_format + os.sep + sickbeard.NAMING_PATTERN
+
+ except (TypeError, ValueError):
+ logger.log(u"Can't change " + old_season_format + " to new season format", logger.ERROR)
+
# if no shows had it on then don't flatten any shows and don't put season folders in the config
else:
-
+
logger.log(u"No shows were using season folders before so I'm disabling flattening on all shows")
-
+
# don't flatten any shows at all
myDB.action("UPDATE tv_shows SET flatten_folders = 0")
sickbeard.NAMING_FORCE_FOLDERS = naming.check_force_season_folders()
-
+
def _name_to_pattern(self, abd=False):
# get the old settings from the file

No commit comments for this range

Something went wrong with that request. Please try again.