示例#1
0
    def skip_show(self, title, season=None):
        if not season:
            tmpl = PageTemplate(file="interface/templates/config-skipshow.tmpl")
            tmpl.title = title
            return str(tmpl)
        else:
            tmpl = PageTemplate(file="interface/templates/message.tmpl")
            if not title:
                raise cherrypy.HTTPError(400, "No show supplied")
            if title.upper() in autosubliminal.SKIPSHOWUPPER:
                for x in autosubliminal.SKIPSHOWUPPER[title.upper()]:
                    if x == season or x == '0':
                        tmpl.message = "Already skipped <br> <a href='" + autosubliminal.WEBROOT + "/home'>Return home</a>"
                        return str(tmpl)
                if season == '00':
                    season = season + ',' + ','.join(autosubliminal.SKIPSHOWUPPER[title.upper()])
                else:
                    season = str(int(season)) + ',' + ','.join(autosubliminal.SKIPSHOWUPPER[title.upper()])
            else:
                if not season == '00':
                    season = str(int(season))
            config.save_config('skipshow', title, season)
            config.apply_skipshow()

            tmpl.message = "Done<br> Remember, WantedQueue will be refresh at the next run of scanDisk <br> <a href='" + autosubliminal.WEBROOT + "/home'>Return home</a>"
            return str(tmpl)
示例#2
0
    def skip_show(self, title, season=None):
        if not season:
            tmpl = Template(file="interface/templates/home/home-skipshow.tmpl")
            tmpl.title = title
            return str(tmpl)
        else:
            tmpl = Template(file="interface/templates/general/message.tmpl")
            if not title:
                raise cherrypy.HTTPError(400, "No show supplied")
            if title.upper() in autosubliminal.SKIPSHOWUPPER:
                for x in autosubliminal.SKIPSHOWUPPER[title.upper()]:
                    if x == season or x == '0':
                        tmpl.message = "Already skipped <br> <a href='" + autosubliminal.WEBROOT + "/home'>Return home</a>"
                        return str(tmpl)
                if season == '00':
                    season = season + ',' + ','.join(
                        autosubliminal.SKIPSHOWUPPER[title.upper()])
                else:
                    season = str(int(season)) + ',' + ','.join(
                        autosubliminal.SKIPSHOWUPPER[title.upper()])
            else:
                if not season == '00':
                    season = str(int(season))
            config.save_config('skipshow', title, season)
            config.apply_skipshow()

            tmpl.message = "Done<br> Remember, WantedQueue will be refreshed at the next run of scanDisk <br> <a href='" + autosubliminal.WEBROOT + "/home'>Return home</a>"
            return str(tmpl)
示例#3
0
    def skip_movie(self, title, year):
        tmpl = Template(file="interface/templates/general/message.tmpl")
        if not title:
            raise cherrypy.HTTPError(400, "No title supplied")
        movie = title
        if year:
            movie += " (" + year + ")"
        if movie.upper() in autosubliminal.SKIPMOVIEUPPER:
            tmpl.message = "Already skipped <br> <a href='" + autosubliminal.WEBROOT + "/home'>Return home</a>"
            return str(tmpl)
        else:
            config.save_config('skipmovie', movie, '0')
            config.apply_skipmovie()

        tmpl.message = "Done<br> Remember, WantedQueue will be refreshed at the next run of scanDisk <br> <a href='" + autosubliminal.WEBROOT + "/home'>Return home</a>"
        return str(tmpl)
示例#4
0
    def skip_movie(self, title, year):
        tmpl = Template(file="interface/templates/general/message.tmpl")
        if not title:
            raise cherrypy.HTTPError(400, "No title supplied")
        movie = title
        if year:
            movie += " (" + year + ")"
        if movie.upper() in autosubliminal.SKIPMOVIEUPPER:
            tmpl.message = "Already skipped <br> <a href='" + autosubliminal.WEBROOT + "/home'>Return home</a>"
            return str(tmpl)
        else:
            config.save_config('skipmovie', movie, '0')
            config.apply_skipmovie()

        tmpl.message = "Done<br> Remember, WantedQueue will be refreshed at the next run of scanDisk <br> <a href='" + autosubliminal.WEBROOT + "/home'>Return home</a>"
        return str(tmpl)