Beispiel #1
0
    def test_movie_with_when(self):
        movie = Movie()
        movie.name = u'Titanic'
        movie.dvd_release = datetime.strptime('1989-08-17', '%Y-%m-%d')
        movie.theater_release = datetime.strptime('1989-02-17', '%Y-%m-%d')
        movie.rating = 9
        movie.create()

        queue = TorrentQueue.load_pending_queue(async=False)
        self.assertEquals(1, len(queue))

        movie = Movie.load(id=1)
        self.assertEquals(1, len(movie))
Beispiel #2
0
    def test_tv_show_with_when_before_air_date(self):
        tv_show = TVShow()
        tv_show.name = u'The Walking Dead'
        tv_show.season_number = 4
        tv_show.episode_number = 10
        tv_show.air_date = datetime.strptime('2089-08-17', '%Y-%m-%d')
        tv_show.episode_name = u'TWD'
        tv_show.rating = 9
        tv_show.create()

        queue = TorrentQueue.load_pending_queue(async=False)
        self.assertEquals(0, len(queue))

        tv_show = TVShow.load(id=1)
        self.assertEquals(1, len(tv_show))
Beispiel #3
0
    def search_for_torrents(self):
        log.msg('Searching for my torrents')

        queue = TorrentQueue.load_pending_queue(async=False)

        for torrent in queue:
            req = self.pirate_bay_client.search(
                query=torrent.query,
                optimize_query=True,
                order=ORDERS.SEEDERS.DES,
                category=CATEGORIES.VIDEO.ALL
            )

            req.load_torrents(
                callback=self.on_torrents_found,
                errback=self.error_finding_torrents,
                db_id=torrent.id
            )