Esempio n. 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"))
Esempio n. 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'))
Esempio n. 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'))
Esempio n. 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'))
Esempio n. 5
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"))
Esempio n. 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'))
Esempio n. 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'))
Esempio n. 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"))
Esempio n. 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'))
Esempio n. 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})
Esempio n. 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'))
Esempio n. 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"))
Esempio n. 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'))
Esempio n. 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'))
Esempio n. 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'))
Esempio n. 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'))
Esempio n. 17
0
    def renewEta(self):

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

        return redirect(url(controller = 'feed', action = 'index'))
Esempio n. 18
0
    def renewEta(self):

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

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