예제 #1
0
    def reAdd(self, id, **data):
        """
        Re-add movie and force search
        """

        movie = Db.query(Movie).filter_by(id=id).one()

        if data.get("failed"):
            for history in movie.history:
                if history.status == u"snatched":
                    history.status = u"ignore"
                    Db.flush()

        for x in movie.queue:
            if x.completed == True:
                x.completed = False
                Db.flush()
                break

        # set status
        movie.status = u"want"
        Db.flush()

        # gogo find nzb for added movie via Cron
        self.cron.get("yarr").forceCheck(id)
        self.searchers.get("etaQueue").put({"id": id})

        self.flash.add("movie-" + str(movie.id), '"%s" re-added.' % (movie.name))
        return redirect(url(controller="movie", action="index"))
예제 #2
0
    def reAdd(self, id, **data):
        '''
        Re-add movie and force search
        '''

        movie = Db.query(Movie).filter_by(id=id).one()

        if data.get('failed'):
            for history in movie.history:
                if history.status == u'snatched':
                    history.status = u'ignore'
                    Db.flush()

        for x in movie.queue:
            if x.completed == True:
                x.completed = False
                Db.flush()
                break

        #set status
        movie.status = u'want'
        Db.flush()

        #gogo find nzb for added movie via Cron
        self.cron.get('yarr').forceCheck(id)
        self.searchers.get('etaQueue').put({'id': id})

        self.flash.add('movie-' + str(movie.id),
                       '"%s" re-added.' % (movie.name))
        return redirect(url(controller='movie', action='index'))
예제 #3
0
    def reAdd(self, id, **data):
        '''
        Re-add movie and force search
        '''

        movie = Db.query(Movie).filter_by(id = id).one()

        if data.get('failed'):
            for history in movie.history:
                if history.status == u'snatched':
                    history.status = u'ignore'
                    Db.flush()

        for x in movie.queue:
            if x.completed == True:
                x.completed = False
                Db.flush()
                break

        #set status
        movie.status = u'want'
        Db.flush()

        #gogo find nzb for added movie via Cron
        self.cron.get('yarr').forceCheck(id)
        self.searchers.get('etaQueue').put({'id':id})

        self.flash.add('movie-' + str(movie.id), '"%s" re-added.' % (movie.name))
        return redirect(url(controller = 'movie', action = 'index'))
예제 #4
0
 def clear_downloaded(self):
     """Clear downloaded movies."""
     qMovie = Db.query(Movie)
     downloaded = qMovie.filter_by(status=u'downloaded').all()
     for movie in downloaded:
         movie.status = u'deleted'
     Db.flush()
     return redirect(url(controller='movie', action='index'))
예제 #5
0
파일: movie.py 프로젝트: rb2k/CouchPotato
 def clear_downloaded(self):
     """Clear downloaded movies."""
     qMovie = Db.query(Movie)
     downloaded = qMovie.filter_by(status=u"downloaded").all()
     for movie in downloaded:
         movie.status = u"deleted"
     Db.flush()
     return redirect(url(controller="movie", action="index"))
예제 #6
0
 def clear_downloaded(self):
     """Clear downloaded movies."""
     qMovie = Db.query(Movie)
     downloaded = qMovie.filter_by(status = u'downloaded').all()
     for movie in downloaded:
       movie.status = u'deleted'
     Db.flush()
     return redirect(url(controller = 'movie', action = 'index'))
예제 #7
0
    def downloaded(self, id):
        '''
        Mark movie as downloaded
        '''

        movie = Db.query(Movie).filter_by(id = id).one()

        #set status
        movie.status = u'downloaded'
        Db.flush()

        self.flash.add('movie-' + str(movie.id), '"%s" marked as downloaded.' % (movie.name))
        return redirect(url(controller = 'movie', action = 'index'))
예제 #8
0
    def downloaded(self, id):
        """
        Mark movie as downloaded
        """

        movie = Db.query(Movie).filter_by(id=id).one()

        # set status
        movie.status = u"downloaded"
        Db.flush()

        self.flash.add("movie-" + str(movie.id), '"%s" marked as downloaded.' % (movie.name))
        return redirect(url(controller="movie", action="index"))
예제 #9
0
    def downloaded(self, id):
        '''
        Mark movie as downloaded
        '''

        movie = Db.query(Movie).filter_by(id=id).one()

        #set status
        movie.status = u'downloaded'
        Db.flush()

        self.flash.add('movie-' + str(movie.id),
                       '"%s" marked as downloaded.' % (movie.name))
        return redirect(url(controller='movie', action='index'))
예제 #10
0
    def index(self):
        '''
        Show all wanted, snatched, downloaded movies
        '''

        if cherrypy.request.path_info == '/':
            return redirect(url(controller = 'movie', action = 'index'))

        qMovie = Db.query(Movie)
        movies = qMovie.order_by(Movie.name).filter(or_(Movie.status == u'want', Movie.status == u'waiting')).all()
        snatched = qMovie.order_by(desc(Movie.dateChanged), Movie.name).filter_by(status = u'snatched').all()
        downloaded = qMovie.order_by(desc(Movie.dateChanged), Movie.name).filter_by(status = u'downloaded').all()

        return self.render({'movies': movies, 'snatched':snatched, 'downloaded':downloaded})
예제 #11
0
    def delete(self, id):
        '''
        Mark movie as deleted
        '''

        movie = Db.query(Movie).filter_by(id = id).one()
        previousStatus = movie.status

        #set status
        movie.status = u'deleted'
        Db.flush()

        if previousStatus == 'downloaded':
            self.flash.add('movie-' + str(movie.id), '"%s" deleted.' % (movie.name))
            return redirect(url(controller = 'movie', action = 'index'))
예제 #12
0
    def delete(self, id):
        """
        Mark movie as deleted
        """

        movie = Db.query(Movie).filter_by(id=id).one()
        previousStatus = movie.status

        # set status
        movie.status = u"deleted"
        Db.flush()

        if previousStatus == "downloaded":
            self.flash.add("movie-" + str(movie.id), '"%s" deleted.' % (movie.name))
            return redirect(url(controller="movie", action="index"))
예제 #13
0
    def delete(self, id):
        '''
        Mark movie as deleted
        '''

        movie = Db.query(Movie).filter_by(id=id).one()
        previousStatus = movie.status

        #set status
        movie.status = u'deleted'
        Db.flush()

        if previousStatus == 'downloaded':
            self.flash.add('movie-' + str(movie.id),
                           '"%s" deleted.' % (movie.name))
            return redirect(url(controller='movie', action='index'))
예제 #14
0
    def clear(self):

        logdir = self.logDir()
        logfile = self.logFile()

        for root, subfiles, filenames in os.walk(logdir):
            log.debug(subfiles)
            for filename in filenames:
                file = os.path.join(root, filename)

                if file == logfile:
                    with open(logfile, 'w') as f:
                        f.write('')
                else:
                    os.remove(file)

        return redirect(url(controller = 'log', action = 'index'))
예제 #15
0
    def clear(self):

        logdir = self.logDir()
        logfile = self.logFile()

        for root, subfiles, filenames in os.walk(logdir):
            log.debug(subfiles)
            for filename in filenames:
                file = os.path.join(root, filename)

                if file == logfile:
                    with open(logfile, 'w') as f:
                        f.write('')
                else:
                    os.remove(file)

        return redirect(url(controller='log', action='index'))
예제 #16
0
    def reAdd(self, id):
        '''
        Re-add movie and force search
        '''

        movie = Db.query(Movie).filter_by(id = id).one()

        for x in movie.queue:
            x.completed = False
            Db.flush()

        #set status
        movie.status = u'want'
        Db.flush()

        #gogo find nzb for added movie via Cron
        self.cron.get('yarr').forceCheck(id)
        self.searchers.get('etaQueue').put({'id':id})

        self.flash.add('movie-' + str(movie.id), '"%s" re-added.' % (movie.name))
        return redirect(url(controller = 'movie', action = 'index'))
예제 #17
0
    def renewEta(self):

        self.cron.get('eta').all()

        return redirect(url(controller = 'feed', action = 'index'))
예제 #18
0
    def renewEta(self):

        self.cron.get('eta').all()

        return redirect(url(controller='feed', action='index'))