How to use the sickrage.helper.common.replace_extension function in sickrage

To help you get started, we’ve selected a few sickrage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pymedusa / Medusa / sickbeard / tv.py View on Github external
self.description = ep_details.findtext('plot')
                    if self.description is None:
                        self.description = ''

                    if ep_details.findtext('aired'):
                        raw_airdate = [int(x) for x in ep_details.findtext('aired').split('-')]
                        self.airdate = datetime.date(raw_airdate[0], raw_airdate[1], raw_airdate[2])
                    else:
                        self.airdate = datetime.date.fromordinal(1)

                    self.hasnfo = True
            else:
                self.hasnfo = False

            if ek(os.path.isfile, replace_extension(nfo_file, 'tbn')):
                self.hastbn = True
            else:
                self.hastbn = False
github pymedusa / Medusa / sickbeard / tv.py View on Github external
return

        logger.log(
            str(self.show.indexerid) + u': Loading episode details from the NFO file associated with ' + location,
            logger.DEBUG)

        self.location = location

        if self.location != '':

            if self.status == UNKNOWN and sickbeard.helpers.isMediaFile(self.location):
                logger.log(u'7 Status changes from ' + str(self.status) + u' to ' + str(
                    Quality.statusFromName(self.location, anime=self.show.is_anime)), logger.DEBUG)
                self.status = Quality.statusFromName(self.location, anime=self.show.is_anime)

            nfo_file = replace_extension(self.location, 'nfo')
            logger.log(str(self.show.indexerid) + u': Using NFO name ' + nfo_file, logger.DEBUG)

            if ek(os.path.isfile, nfo_file):
                try:
                    show_xml = ETree.ElementTree(file=nfo_file)
                except (SyntaxError, ValueError) as e:
                    logger.log(u'Error loading the NFO, backing up the NFO and skipping for now: ' + ex(e),
                               logger.ERROR)
                    try:
                        ek(os.rename, nfo_file, nfo_file + '.old')
                    except Exception as e:
                        logger.log(u"Failed to rename your episode's NFO file - "
                                   u'you need to delete it or fix it: ' + ex(e), logger.ERROR)
                    raise NoNFOException('Error in NFO format')

                for ep_details in list(show_xml.iter('episodedetails')):