Esempio n. 1
0
    def loadShowsFromDB():
        """
        Populates the showList with shows from the database
        """
        logging.debug("Loading initial show list")

        myDB = db.DBConnection()
        sqlResults = myDB.select("SELECT * FROM tv_shows")

        sickbeard.showList = []
        for sqlShow in sqlResults:
            try:
                curShow = TVShow(int(sqlShow[b"indexer"]), int(sqlShow[b"indexer_id"]))

                # Build internal name cache for show
                name_cache.buildNameCache(curShow)

                # get next episode info
                curShow.nextEpisode()

                # add show to internal show list
                sickbeard.showList.append(curShow)
            except Exception as e:
                logging.error(
                        "There was an error creating the show in " + sqlShow[b"location"] + ": " + str(e).decode(
                                'utf-8'))
                logging.debug(traceback.format_exc())
Esempio n. 2
0
    def load_shows_from_db():
        """
        Populates the showList with shows from the database
        """
        logger.log('Loading initial show list', logger.DEBUG)  # pylint: disable=no-member

        main_db_con = db.DBConnection()
        sql_results = main_db_con.select(
            'SELECT indexer, indexer_id, location FROM tv_shows;')

        sickbeard.showList = []
        for sql_show in sql_results:
            try:
                cur_show = TVShow(sql_show[b'indexer'],
                                  sql_show[b'indexer_id'])
                cur_show.nextEpisode()
                sickbeard.showList.append(cur_show)
            except Exception as error:  # pylint: disable=broad-except
                logger.log(
                    'There was an error creating the show in {location}: Error {error_num}: {error_message}'
                    .format  # pylint: disable=no-member
                    (location=sql_show[b'location'],
                     error_num=error.errorno,
                     error_message=error.strerror),
                    logger.ERROR)
                logger.log(traceback.format_exc(), logger.DEBUG)  # pylint: disable=no-member
Esempio n. 3
0
    def loadShowsFromDB():
        """
        Populates the showList with shows from the database
        """
        logging.debug("Loading initial show list")

        myDB = db.DBConnection()
        sqlResults = myDB.select("SELECT * FROM tv_shows")

        sickbeard.showList = []
        for sqlShow in sqlResults:
            try:
                curShow = TVShow(int(sqlShow[b"indexer"]),
                                 int(sqlShow[b"indexer_id"]))

                # Build internal name cache for show
                name_cache.buildNameCache(curShow)

                # get next episode info
                curShow.nextEpisode()

                # add show to internal show list
                sickbeard.showList.append(curShow)
            except Exception as e:
                logging.error("There was an error creating the show in " +
                              sqlShow[b"location"] + ": " +
                              str(e).decode('utf-8'))
                logging.debug(traceback.format_exc())
Esempio n. 4
0
    def load_shows_from_db():
        """
        Populates the showList with shows from the database
        """
        logger.log('Loading initial show list', logger.DEBUG)

        main_db_con = db.DBConnection()
        sql_results = main_db_con.select('SELECT indexer, indexer_id, location FROM tv_shows;')

        sickbeard.showList = []
        for sql_show in sql_results:
            try:
                cur_show = TVShow(sql_show[b'indexer'], sql_show[b'indexer_id'])
                cur_show.nextEpisode()
                sickbeard.showList.append(cur_show)
            except Exception as error:  # pylint: disable=broad-except
                logger.log('There was an error creating the show in {0}: Error {1}'.format
                           (sql_show[b'location'], error), logger.ERROR)
                logger.log(traceback.format_exc(), logger.DEBUG)
Esempio n. 5
0
    def load_shows_from_db():
        """
        Populates the showList with shows from the database
        """

        logger.log(u'Loading initial show list')

        my_db = db.DBConnection()
        sql_results = my_db.select('SELECT * FROM tv_shows')

        sickbeard.showList = []
        for sqlShow in sql_results:
            try:
                cur_show = TVShow(int(sqlShow['indexer']), int(sqlShow['indexer_id']))
                cur_show.nextEpisode()
                sickbeard.showList.append(cur_show)
            except Exception as er:
                logger.log('There was an error creating the show in %s: %s' % (
                    sqlShow['location'], str(er).decode('utf-8', 'replace')), logger.ERROR)
Esempio n. 6
0
    def loadShowsFromDB():
        """
        Populates the showList with shows from the database
        """
        logger.log(u"Loading initial show list", logger.DEBUG)

        myDB = db.DBConnection()
        sqlResults = myDB.select("SELECT indexer, indexer_id, location FROM tv_shows;")

        sickbeard.showList = []
        for sqlShow in sqlResults:
            try:
                curShow = TVShow(int(sqlShow["indexer"]), int(sqlShow["indexer_id"]))
                curShow.nextEpisode()
                sickbeard.showList.append(curShow)
            except Exception as e:
                logger.log(
                    u"There was an error creating the show in " + sqlShow["location"] + ": " + str(e).decode('utf-8'),
                    logger.ERROR)
                logger.log(traceback.format_exc(), logger.DEBUG)
Esempio n. 7
0
    def loadShowsFromDB():
        """
        Populates the showList with shows from the database
        """
        logger.log(u"Loading initial show list", logger.DEBUG)

        myDB = db.DBConnection()
        sqlResults = myDB.select("SELECT indexer, indexer_id, location FROM tv_shows;")

        sickbeard.showList = []
        for sqlShow in sqlResults:
            try:
                curShow = TVShow(int(sqlShow["indexer"]), int(sqlShow["indexer_id"]))
                curShow.nextEpisode()
                sickbeard.showList.append(curShow)
            except Exception, e:
                logger.log(
                    u"There was an error creating the show in " + sqlShow["location"] + ": " + str(e).decode('utf-8'),
                    logger.ERROR)
                logger.log(traceback.format_exc(), logger.DEBUG)
Esempio n. 8
0
    def load_shows_from_db():
        """
        Populates the showList with shows from the database
        """
        logger.log('Loading initial show list', logger.DEBUG)

        main_db_con = db.DBConnection()
        sql_results = main_db_con.select(
            'SELECT indexer, indexer_id, location FROM tv_shows;')

        sickbeard.showList = []
        for sql_show in sql_results:
            try:
                cur_show = TVShow(sql_show[b'indexer'],
                                  sql_show[b'indexer_id'])
                cur_show.nextEpisode()
                sickbeard.showList.append(cur_show)
            except Exception as error:
                logger.log(
                    'There was an error creating the show in {0}: Error {1}'.
                    format(sql_show[b'location'], error), logger.ERROR)
                logger.log(traceback.format_exc(), logger.DEBUG)
Esempio n. 9
0
    def load_shows_from_db():
        """
        Populates the showList with shows from the database
        """
        logger.log("Loading initial show list", logger.DEBUG)  # pylint: disable=no-member

        main_db_con = db.DBConnection()
        sql_results = main_db_con.select("SELECT indexer, indexer_id, location FROM tv_shows;")

        sickbeard.showList = []
        for sql_show in sql_results:
            try:
                cur_show = TVShow(sql_show[b"indexer"], sql_show[b"indexer_id"])
                cur_show.nextEpisode()
                sickbeard.showList.append(cur_show)
            except Exception as error_msg:  # pylint: disable=broad-except
                logger.log(
                    "There was an error creating the show in %s: %s"
                    % (sql_show[b"location"], str(error_msg).decode()),  # pylint: disable=no-member
                    logger.ERROR,
                )
                logger.log(traceback.format_exc(), logger.DEBUG)  # pylint: disable=no-member
Esempio n. 10
0
    def loadShowsFromDB(self):
        """
        Populates the showList with shows from the database
        """

        logger.log(u"Loading initial show list")

        myDB = db.DBConnection()
        sqlResults = myDB.select("SELECT * FROM tv_shows")

        sickbeard.showList = []
        for sqlShow in sqlResults:
            try:
                curShow = TVShow(int(sqlShow["indexer"]), int(sqlShow["indexer_id"]))
                curShow.nextEpisode()
                sickbeard.showList.append(curShow)
            except Exception, e:
                logger.log(
                    u"There was an error creating the show in "
                    + sqlShow["location"]
                    + ": "
                    + str(e).decode("utf-8", "replace"),
                    logger.ERROR,
                )