def updateNewFilePrefix(self, aka=None): """ Update the new FileName prefix for videos, nfo, etc Format: http://forum.boxee.tv/showthread.php?t=5214 @param aka: Optional alternative title (useful for foreign videos) """ year = self.year or self.curYear self.newFilePrefix = aka or self.title or self.curTitle self.newFilePrefix = util.replaceChars(self.newFilePrefix, REPLACE_CHARS) self.newFilePrefix = util.removeChars(self.newFilePrefix, INVALID_CHARS) self.newFilePrefix = self.newFilePrefix.replace(' ', '.') self.newFilePrefix = util.removeExtraChars(self.newFilePrefix, '.') self.newFilePrefix = self.newFilePrefix.lower() if (year): self.newFilePrefix = "%s.(%s)" % (self.newFilePrefix, year)
def updateNewDirName(self, aka=None): """ Update the new DirName to place video files. Format: http://forum.boxee.tv/showthread.php?t=5214 @param aka: Optional alternative title (useful for foreign videos) """ year = self.year or self.curYear self.newDirName = aka or self.title or self.curTitle self.newDirName = util.replaceChars(self.newDirName, REPLACE_CHARS) self.newDirName = util.removeChars(self.newDirName, INVALID_CHARS) self.newDirName = util.removePrefixWords(self.newDirName, STOP_WORDS) self.newDirName = util.removeExtraChars(self.newDirName, '.') if (aka) and (year): self.newDirName = "%s (%s-%s)" % (self.newDirName, self.country, year) elif (aka): self.newDirName = "%s (%s)" % (self.newDirName, self.country) elif (year): self.newDirName = "%s (%s)" % (self.newDirName, year)