# Buggy code
def _load_from_db(self):
    log.debug("{id}: Loading show info from database", {"id": self.series_id})

    main_db_con = db.DBConnection()
    sql_results = main_db_con.select(
        "SELECT * FROM tv_shows WHERE indexer = ? AND indexer_id = ?",
        [self.indexer, self.series_id],
    )

    if not sql_results:
        log.info(
            "{id}: Unable to find the show in the database", {"id": self.series_id}
        )
        return
    else:
        self.show_id = int(sql_results[0]["show_id"] or 0)
        self.indexer = int(sql_results[0]["indexer"] or 0)

        if not self.name:
            self.name = sql_results[0]["show_name"]
        if not self.network:
            self.network = sql_results[0]["network"]
        if not self.genre:
            self.genre = sql_results[0]["genre"]
        if not self.classification:
            self.classification = sql_results[0]["classification"]

        self.runtime = sql_results[0]["runtime"]

        self.status = sql_results[0]["status"]
        if self.status is None:
            self.status = "Unknown"

        self.airs = sql_results[0]["airs"]
        if self.airs is None or not network_timezones.test_timeformat(self.airs):
            self.airs = ""

        self.start_year = int(sql_results[0]["startyear"] or 0)
        self.air_by_date = int(sql_results[0]["air_by_date"] or 0)
        self.anime = int(sql_results[0]["anime"] or 0)
        self.sports = int(sql_results[0]["sports"] or 0)
        self.scene = int(sql_results[0]["scene"] or 0)
        self.subtitles = int(sql_results[0]["subtitles"] or 0)
        self.notify_list = dict(ast.literal_eval(sql_results[0]["notify_list"] or "{}"))
        self.dvd_order = int(sql_results[0]["dvdorder"] or 0)
        self.quality = int(sql_results[0]["quality"] or Quality.NA)
        self.season_folders = int(
            not (sql_results[0]["flatten_folders"] or 0)
        )  # TODO: Rename this in the DB
        self.paused = int(sql_results[0]["paused"] or 0)
        self._location = sql_results[0]["location"]  # skip location validation

        if not self.lang:
            self.lang = sql_results[0]["lang"]

        self.last_update_indexer = sql_results[0]["last_update_indexer"]

        self.rls_ignore_words = sql_results[0]["rls_ignore_words"]
        self.rls_require_words = sql_results[0]["rls_require_words"]
        self.rls_ignore_exclude = sql_results[0]["rls_ignore_exclude"]
        self.rls_require_exclude = sql_results[0]["rls_require_exclude"]

        self.default_ep_status = int(sql_results[0]["default_ep_status"] or SKIPPED)

        if not self.imdb_id:
            self.imdb_id = sql_results[0]["imdb_id"]

        self.release_groups = BlackAndWhiteList(self)

        self.plot = sql_results[0]["plot"]

        # Load external id's from indexer_mappings table.
        self.externals = load_externals_from_db(self.indexer, self.series_id)

        self.airdate_offset = int(sql_results[0]["airdate_offset"])

    # Get IMDb_info from database
    main_db_con = db.DBConnection()
    sql_results = main_db_con.select(
        "SELECT * FROM imdb_info WHERE indexer = ? AND indexer_id = ?",
        [self.indexer, self.series_id],
    )

    if not sql_results:
        log.info(
            "{id}: Unable to find IMDb info in the database: {show}",
            {"id": self.series_id, "show": self.name},
        )
        return
    else:
        self.imdb_info = sql_results[0]

    self.reset_dirty()
    return True


# Traceback (TypeError)
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: The.Walking.Dead.S08E06.VOSTFR.1080p.WEB-DL.DD5.1.H264-ARK01.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] Skipping already processed file: The.Walking.Dead.S08E06.VOSTFR.1080p.WEB-DL.DD5.1.H264-ARK01.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: Outlander.S03E11.MULTi.1080p.WEB.x264-CiELOS.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] Skipping already processed file: Outlander.S03E11.MULTi.1080p.WEB.x264-CiELOS.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: Shameless.US.S08E04.VOSTFR.1080p.WEB.H264-SCTE.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] Skipping already processed file: Shameless.US.S08E04.VOSTFR.1080p.WEB.H264-SCTE.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: Vikings.S05E01-E02.FASTSUB.VOSTFR.720p.HDTV.x264-ZT.WwW.Torrent9.tv.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] Skipping already processed file: Vikings.S05E01-E02.FASTSUB.VOSTFR.720p.HDTV.x264-ZT.WwW.Torrent9.tv.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: Shameless.US.S08E05.PROPER.VOSTFR.1080p.AMZN.WEB-DL.DDP5.1.H.264-Pastaga.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] Skipping already processed file: Shameless.US.S08E05.PROPER.VOSTFR.1080p.AMZN.WEB-DL.DDP5.1.H.264-Pastaga.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: Mr.Robot.S03E08.SUBFRENCH.720p.WEB-DL.H264-EXTREME.WwW.Torrent9.tv.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] Skipping already processed file: Mr.Robot.S03E08.SUBFRENCH.720p.WEB-DL.H264-EXTREME.WwW.Torrent9.tv.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: The.Walking.Dead.S08E07.VOSTFR.720p.HDTV.x264-WEEDS.WwW.Torrent9.tv.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] Skipping already processed file: The.Walking.Dead.S08E07.VOSTFR.720p.HDTV.x264-WEEDS.WwW.Torrent9.tv.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: Mr.Robot.S03E09.FASTSUB.VOSTFR.720p.WEB.H264-ZT.WwW.Torrent9.tv.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] Skipping already processed file: Mr.Robot.S03E09.FASTSUB.VOSTFR.720p.WEB.H264-ZT.WwW.Torrent9.tv.mkv
2017-12-11 21:30:45 INFO     Thread-17 :: [1a8dc66] Processing /media/NAS/Series/Telechargements/Shokugeki.no.Soma S03E01.SUBFRENCH.720p.WEBRip.x264-BSD.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] Analyzing name: Shokugeki.no.Soma S03E01.SUBFRENCH.720p.WEBRip.x264-BSD.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] Using cached parse result for Shokugeki.no.Soma S03E01.SUBFRENCH.720p.WEBRip.x264-BSD.mkv
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] Show information parsed from file name
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] Retrieving episode object for Food Wars!: Shokugeki no Soma S03E01
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] The episode file has a quality in it, using that: 720p WEB-DL
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] Quality of the episode we are processing: 720p WEB-DL
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] Snatch in history: False
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] Manually snatched: False
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] Current quality: 720p WEB-DL
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] New quality: 720p WEB-DL
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] Proper: False
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] This episode is a priority download: False
2017-12-11 21:30:45 INFO     Thread-17 :: [1a8dc66] New file: /media/NAS/Series/Telechargements/Shokugeki.no.Soma S03E01.SUBFRENCH.720p.WEBRip.x264-BSD.mkv
2017-12-11 21:30:45 INFO     Thread-17 :: [1a8dc66] New size: 329.74 MB
2017-12-11 21:30:45 DEBUG    Thread-17 :: [1a8dc66] There is no existing file so there's no worries about replacing it
2017-12-11 21:30:45 ERROR    Thread-17 :: [1a8dc66] Exception generated: int() argument must be a string or a number, not 'NoneType'
Traceback (most recent call last):
  File "/home/**********/medusa/medusa/server/web/core/base.py", line 263, in async_call
    result = function(**kwargs)
  File "/home/**********/medusa/medusa/server/web/home/post_process.py", line 50, in processEpisode
    ignore_subs=argToBool(ignore_subs)
  File "/home/**********/medusa/medusa/process_tv.py", line 146, in process
    ignore_subs=ignore_subs)
  File "/home/**********/medusa/medusa/process_tv.py", line 335, in process_files
    self.process_media(path, self.video_files, force, is_priority, ignore_subs)
  File "/home/**********/medusa/medusa/process_tv.py", line 536, in process_media
    self.result = processor.process()
  File "/home/**********/medusa/medusa/post_processor.py", line 1068, in process
    if int(ep_obj.season) > int(max_season[0][0]):
TypeError: int() argument must be a string or a number, not 'NoneType'
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Processing path: /media/NAS/Series/Telechargements
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Processing folder: /media/NAS/Series/Telechargements
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Post-processing files: [u'House.Of.Cards.S03E13.FINAL.FRENCH.WEBRIP.XviD-ZT.avi', u'.DS_Store', u'mr.robot.s03e07.subfrench.720p.web.h264-cielos.WwW.Torrent9.tv.mkv', u'The.Walking.Dead.S08E06.VOSTFR.1080p.WEB-DL.DD5.1.H264-ARK01.mkv', u'Outlander.S03E11.MULTi.1080p.WEB.x264-CiELOS.mkv', u'Shameless.US.S08E04.VOSTFR.1080p.WEB.H264-SCTE.mkv', u'Vikings.S05E01-E02.FASTSUB.VOSTFR.720p.HDTV.x264-ZT.WwW.Torrent9.tv.mkv', u'Shameless.US.S08E05.PROPER.VOSTFR.1080p.AMZN.WEB-DL.DDP5.1.H.264-Pastaga.mkv', u'Mr.Robot.S03E08.SUBFRENCH.720p.WEB-DL.H264-EXTREME.WwW.Torrent9.tv.mkv', u'The.Walking.Dead.S08E07.VOSTFR.720p.HDTV.x264-WEEDS.WwW.Torrent9.tv.mkv', u'Mr.Robot.S03E09.FASTSUB.VOSTFR.720p.WEB.H264-ZT.WwW.Torrent9.tv.mkv', u'Shokugeki.no.Soma S03E01.SUBFRENCH.720p.WEBRip.x264-BSD.mkv', u'Shokugeki.no.Soma S03E03.SUBFRENCH.720p.WEBRip.x264-BSD.mkv', u'Shokugeki.no.Soma.San.no.Sara.S03E02.SUBFRENCH.720p.WEBRip.x264-BSD.mkv', u'Shokugeki.no.Soma.San.no.Sara.S03E04.SUBFRENCH.720p.WEBRip.x264-BSD.mkv']
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Post-processing video files: [u'House.Of.Cards.S03E13.FINAL.FRENCH.WEBRIP.XviD-ZT.avi', u'mr.robot.s03e07.subfrench.720p.web.h264-cielos.WwW.Torrent9.tv.mkv', u'The.Walking.Dead.S08E06.VOSTFR.1080p.WEB-DL.DD5.1.H264-ARK01.mkv', u'Outlander.S03E11.MULTi.1080p.WEB.x264-CiELOS.mkv', u'Shameless.US.S08E04.VOSTFR.1080p.WEB.H264-SCTE.mkv', u'Vikings.S05E01-E02.FASTSUB.VOSTFR.720p.HDTV.x264-ZT.WwW.Torrent9.tv.mkv', u'Shameless.US.S08E05.PROPER.VOSTFR.1080p.AMZN.WEB-DL.DDP5.1.H.264-Pastaga.mkv', u'Mr.Robot.S03E08.SUBFRENCH.720p.WEB-DL.H264-EXTREME.WwW.Torrent9.tv.mkv', u'The.Walking.Dead.S08E07.VOSTFR.720p.HDTV.x264-WEEDS.WwW.Torrent9.tv.mkv', u'Mr.Robot.S03E09.FASTSUB.VOSTFR.720p.WEB.H264-ZT.WwW.Torrent9.tv.mkv', u'Shokugeki.no.Soma S03E01.SUBFRENCH.720p.WEBRip.x264-BSD.mkv', u'Shokugeki.no.Soma S03E03.SUBFRENCH.720p.WEBRip.x264-BSD.mkv', u'Shokugeki.no.Soma.San.no.Sara.S03E02.SUBFRENCH.720p.WEBRip.x264-BSD.mkv', u'Shokugeki.no.Soma.San.no.Sara.S03E04.SUBFRENCH.720p.WEBRip.x264-BSD.mkv']
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Found unwanted files: [u'.DS_Store']
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: House.Of.Cards.S03E13.FINAL.FRENCH.WEBRIP.XviD-ZT.avi
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Skipping already processed file: House.Of.Cards.S03E13.FINAL.FRENCH.WEBRIP.XviD-ZT.avi
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: mr.robot.s03e07.subfrench.720p.web.h264-cielos.WwW.Torrent9.tv.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Skipping already processed file: mr.robot.s03e07.subfrench.720p.web.h264-cielos.WwW.Torrent9.tv.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: The.Walking.Dead.S08E06.VOSTFR.1080p.WEB-DL.DD5.1.H264-ARK01.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Skipping already processed file: The.Walking.Dead.S08E06.VOSTFR.1080p.WEB-DL.DD5.1.H264-ARK01.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: Outlander.S03E11.MULTi.1080p.WEB.x264-CiELOS.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Skipping already processed file: Outlander.S03E11.MULTi.1080p.WEB.x264-CiELOS.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: Shameless.US.S08E04.VOSTFR.1080p.WEB.H264-SCTE.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Skipping already processed file: Shameless.US.S08E04.VOSTFR.1080p.WEB.H264-SCTE.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: Vikings.S05E01-E02.FASTSUB.VOSTFR.720p.HDTV.x264-ZT.WwW.Torrent9.tv.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Skipping already processed file: Vikings.S05E01-E02.FASTSUB.VOSTFR.720p.HDTV.x264-ZT.WwW.Torrent9.tv.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: Shameless.US.S08E05.PROPER.VOSTFR.1080p.AMZN.WEB-DL.DDP5.1.H.264-Pastaga.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Skipping already processed file: Shameless.US.S08E05.PROPER.VOSTFR.1080p.AMZN.WEB-DL.DDP5.1.H.264-Pastaga.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: Mr.Robot.S03E08.SUBFRENCH.720p.WEB-DL.H264-EXTREME.WwW.Torrent9.tv.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Skipping already processed file: Mr.Robot.S03E08.SUBFRENCH.720p.WEB-DL.H264-EXTREME.WwW.Torrent9.tv.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: The.Walking.Dead.S08E07.VOSTFR.720p.HDTV.x264-WEEDS.WwW.Torrent9.tv.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Skipping already processed file: The.Walking.Dead.S08E07.VOSTFR.720p.HDTV.x264-WEEDS.WwW.Torrent9.tv.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] You're trying to post-process a file that has already been processed, skipping: Mr.Robot.S03E09.FASTSUB.VOSTFR.720p.WEB.H264-ZT.WwW.Torrent9.tv.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Skipping already processed file: Mr.Robot.S03E09.FASTSUB.VOSTFR.720p.WEB.H264-ZT.WwW.Torrent9.tv.mkv
2017-12-11 21:30:50 INFO     Thread-19 :: [1a8dc66] Processing /media/NAS/Series/Telechargements/Shokugeki.no.Soma S03E01.SUBFRENCH.720p.WEBRip.x264-BSD.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Analyzing name: Shokugeki.no.Soma S03E01.SUBFRENCH.720p.WEBRip.x264-BSD.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Using cached parse result for Shokugeki.no.Soma S03E01.SUBFRENCH.720p.WEBRip.x264-BSD.mkv
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Show information parsed from file name
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Retrieving episode object for Food Wars!: Shokugeki no Soma S03E01
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] The episode file has a quality in it, using that: 720p WEB-DL
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Quality of the episode we are processing: 720p WEB-DL
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Snatch in history: False
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Manually snatched: False
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Current quality: 720p WEB-DL
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] New quality: 720p WEB-DL
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] Proper: False
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] This episode is a priority download: False
2017-12-11 21:30:50 INFO     Thread-19 :: [1a8dc66] New file: /media/NAS/Series/Telechargements/Shokugeki.no.Soma S03E01.SUBFRENCH.720p.WEBRip.x264-BSD.mkv
2017-12-11 21:30:50 INFO     Thread-19 :: [1a8dc66] New size: 329.74 MB
2017-12-11 21:30:50 DEBUG    Thread-19 :: [1a8dc66] There is no existing file so there's no worries about replacing it
2017-12-11 21:30:50 ERROR    Thread-19 :: [1a8dc66] Exception generated: int() argument must be a string or a number, not 'NoneType'
Traceback (most recent call last):
  File "/home/**********/medusa/medusa/server/web/core/base.py", line 263, in async_call
    result = function(**kwargs)
  File "/home/**********/medusa/medusa/server/web/home/post_process.py", line 50, in processEpisode
    ignore_subs=argToBool(ignore_subs)
  File "/home/**********/medusa/medusa/process_tv.py", line 146, in process
    ignore_subs=ignore_subs)
  File "/home/**********/medusa/medusa/process_tv.py", line 335, in process_files
    self.process_media(path, self.video_files, force, is_priority, ignore_subs)
  File "/home/**********/medusa/medusa/process_tv.py", line 536, in process_media
    self.result = processor.process()
  File "/home/**********/medusa/medusa/post_processor.py", line 1068, in process
    if int(ep_obj.season) > int(max_season[0][0]):
TypeError: int() argument must be a string or a number, not 'NoneType'

# Fixed code
def _load_from_db(self):
    log.debug("{id}: Loading show info from database", {"id": self.series_id})

    main_db_con = db.DBConnection()
    sql_results = main_db_con.select(
        "SELECT * FROM tv_shows WHERE indexer = ? AND indexer_id = ?",
        [self.indexer, self.series_id],
    )

    if not sql_results:
        log.info(
            "{id}: Unable to find the show in the database", {"id": self.series_id}
        )
        return
    else:
        self.show_id = int(sql_results[0]["show_id"] or 0)
        self.indexer = int(sql_results[0]["indexer"] or 0)

        if not self.name:
            self.name = sql_results[0]["show_name"]
        if not self.network:
            self.network = sql_results[0]["network"]
        if not self.genre:
            self.genre = sql_results[0]["genre"]
        if not self.classification:
            self.classification = sql_results[0]["classification"]

        self.runtime = sql_results[0]["runtime"]

        self.status = sql_results[0]["status"]
        if self.status is None:
            self.status = "Unknown"

        self.airs = sql_results[0]["airs"]
        if self.airs is None or not network_timezones.test_timeformat(self.airs):
            self.airs = ""

        self.start_year = int(sql_results[0]["startyear"] or 0)
        self.air_by_date = int(sql_results[0]["air_by_date"] or 0)
        self.anime = int(sql_results[0]["anime"] or 0)
        self.sports = int(sql_results[0]["sports"] or 0)
        self.scene = int(sql_results[0]["scene"] or 0)
        self.subtitles = int(sql_results[0]["subtitles"] or 0)
        self.notify_list = dict(ast.literal_eval(sql_results[0]["notify_list"] or "{}"))
        self.dvd_order = int(sql_results[0]["dvdorder"] or 0)
        self.quality = int(sql_results[0]["quality"] or Quality.NA)
        self.season_folders = int(
            not (sql_results[0]["flatten_folders"] or 0)
        )  # TODO: Rename this in the DB
        self.paused = int(sql_results[0]["paused"] or 0)
        self._location = sql_results[0]["location"]  # skip location validation

        if not self.lang:
            self.lang = sql_results[0]["lang"]

        self.last_update_indexer = sql_results[0]["last_update_indexer"]

        self.rls_ignore_words = sql_results[0]["rls_ignore_words"]
        self.rls_require_words = sql_results[0]["rls_require_words"]
        self.rls_ignore_exclude = sql_results[0]["rls_ignore_exclude"]
        self.rls_require_exclude = sql_results[0]["rls_require_exclude"]

        self.default_ep_status = int(sql_results[0]["default_ep_status"] or SKIPPED)

        if not self.imdb_id:
            self.imdb_id = sql_results[0]["imdb_id"]

        self.plot = sql_results[0]["plot"]
        self.airdate_offset = int(sql_results[0]["airdate_offset"])

        self.release_groups = BlackAndWhiteList(self)

        # Load external id's from indexer_mappings table.
        self.externals = load_externals_from_db(self.indexer, self.series_id)

    # Get IMDb_info from database
    main_db_con = db.DBConnection()
    sql_results = main_db_con.select(
        "SELECT * FROM imdb_info WHERE indexer = ? AND indexer_id = ?",
        [self.indexer, self.series_id],
    )

    if not sql_results:
        log.info(
            "{id}: Unable to find IMDb info in the database: {show}",
            {"id": self.series_id, "show": self.name},
        )
        return
    else:
        self.imdb_info = sql_results[0]

    self.reset_dirty()
    return True