示例#1
0
    def _get_episode_search_strings(self, show, season, episode, abd=False, add_string=""):

        search_string = {"Episode": []}

        if not episode:
            return []

        if abd:
            for show_name in set(show_name_helpers.allPossibleShowNames(show)):
                ep_string = (
                    sanitizeSceneName(show_name)
                    + " "
                    + str(episode).replace("-", "|")
                    + "|"
                    + helpers.custom_strftime("%b", episode)
                )
                search_string["Episode"].append(ep_string)
        else:
            for show_name in set(show_name_helpers.allPossibleShowNames(show)):
                ep_string = (
                    show_name_helpers.sanitizeSceneName(show_name)
                    + " "
                    + sickbeard.config.naming_ep_type[2] % {"seasonnumber": season, "episodenumber": episode}
                )

                search_string["Episode"].append(re.sub("\s+", " ", ep_string))

        return [search_string]
示例#2
0
    def _get_episode_search_strings(self, ep_obj, add_string=""):

        search_string = {"Episode": []}

        if not ep_obj:
            return []

        if ep_obj.show.air_by_date:
            for show_name in set(show_name_helpers.allPossibleShowNames(ep_obj.show)):
                ep_string = (
                    show_name_helpers.sanitizeSceneName(show_name)
                    + " "
                    + str(ep_obj.airdate)
                    + "|"
                    + helpers.custom_strftime("%Y %b {S}", ep_obj.airdate)
                )
                search_string["Episode"].append(ep_string)
        else:
            for show_name in set(show_name_helpers.allPossibleShowNames(ep_obj.show)):
                ep_string = (
                    show_name_helpers.sanitizeSceneName(show_name)
                    + " "
                    + sickbeard.config.naming_ep_type[2]
                    % {"seasonnumber": ep_obj.season, "episodenumber": ep_obj.episode}
                    + " %s" % add_string
                )

                search_string["Episode"].append(re.sub("\s+", " ", ep_string))

        return [search_string]
示例#3
0
    def _get_episode_search_strings(self, show, season, episode, abd=False, add_string=''):
        search_string = {'Episode': []}

        if not show:
            return []

        self.show = show

        if abd:
            for show_name in set(allPossibleShowNames(show)):

                ep_string = sanitizeSceneName(show_name) + ' ' + \
                            str(episode).replace('-','|') + '|' + \
                            helpers.custom_strftime('%b', episode)
                search_string['Episode'].append(ep_string)
        else:
            for show_name in set(allPossibleShowNames(show)):
                ep_string = sanitizeSceneName(show_name) + ' ' + \
                            sickbeard.config.naming_ep_type[2] % {'seasonnumber': season,
                                                                  'episodenumber': episode} + '|' + \
                            sickbeard.config.naming_ep_type[0] % {'seasonnumber': season,
                                                                  'episodenumber': episode} + '|' + \
                            sickbeard.config.naming_ep_type[3] % {'seasonnumber': season,
                                                                  'episodenumber': episode} + ' %s category:tv' % add_string
                search_string['Episode'].append(re.sub('\s+', ' ', ep_string))

        return [search_string]
示例#4
0
    def _get_episode_search_strings(self, ep_obj, add_string=''):

        search_string = {'Episode': []}

        if not ep_obj:
            return []

        self.show = ep_obj.show

        if ep_obj.show.air_by_date:
            for show_name in set(allPossibleShowNames(ep_obj.show)):
                ep_string = sanitizeSceneName(show_name) + ' ' + \
                            str(ep_obj.airdate) + '|' + \
                            helpers.custom_strftime('%Y %b {S}', ep_obj.airdate)

                search_string['Episode'].append(ep_string)
        else:
            for show_name in set(allPossibleShowNames(ep_obj.show)):
                ep_string = sanitizeSceneName(show_name) + ' ' + \
                            sickbeard.config.naming_ep_type[2] % {'seasonnumber': ep_obj.season,
                                                                  'episodenumber': ep_obj.episode} + '|' + \
                            sickbeard.config.naming_ep_type[0] % {'seasonnumber': ep_obj.season,
                                                                  'episodenumber': ep_obj.episode} + '|' + \
                            sickbeard.config.naming_ep_type[3] % {'seasonnumber': ep_obj.season,
                                                                  'episodenumber': ep_obj.episode} + ' %s category:tv' % add_string
                search_string['Episode'].append(re.sub('\s+', ' ', ep_string))

        return [search_string]
示例#5
0
    def _get_episode_search_strings(self, show, season, episode, abd=False, add_string=''):

        search_string = {'Episode': []}

        if not episode:
            return []

        if abd:
            for show_name in set(allPossibleShowNames(show)):
                ep_string = sanitizeSceneName(show_name) + ' ' + \
                            str(episode).replace('-', '|') + '|' + \
                            helpers.custom_strftime('%b', episode)
                search_string['Episode'].append(ep_string)
        else:
            for show_name in set(allPossibleShowNames(show)):
                ep_string = sanitizeSceneName(show_name) + ' ' + \
                            sickbeard.config.naming_ep_type[2] % {'seasonnumber': season,
                                                                  'episodenumber': episode}

                for x in add_string.split('|'):
                    to_search = re.sub('\s+', ' ', ep_string + ' %s' % x)
                    search_string['Episode'].append(to_search)

        return [search_string]