def dofullScan(self, dirs):
        
        self.status = "SCANNING"
        
        logging.info(u"Monitor: Beginning file scan...")
        self.setStatusDetail(u"Monitor: Making a list of all files in the folders...")

        filelist = utils.get_recursive_filelist( dirs )
        self.setStatusDetail(u"Monitor: sorting recursive file list ({0} items)".format(len(filelist)))
        filelist = sorted(filelist, key=os.path.getmtime)
        
        self.setStatusDetail(u"Monitor: done listing files.")
        
        self.add_count = 0      
        self.remove_count = 0
        
        # get the entire comic table into memory
        query = list(self.session.query(Comic))
        
        # look for missing or changed files 
        self.setStatusDetail(u"Monitor: Removing missing or modified files from DB...")
        #start_time = time.time()
        for comic in query:
            self.checkIfRemovedOrModified( comic, self.paths )
            if self.quit:
                self.setStatusDetail(u"Monitor: halting scan!")
                return
                
        #print time.time() - start_time, "seconds"
        self.setStatusDetail(u"Monitor: Done removing files.")
        
        if self.remove_count > 0:
            self.dm.engine.echo = True
            self.session.commit()
            self.dm.engine.echo = False

        self.setStatusDetail(u"Monitor: found {0} files to inspect...".format(len(filelist)))
        
        # make a list of all path strings in comic table
        db_pathlist = [i[0] for i in list(self.session.query(Comic.path))]
        
        self.setStatusDetail(u"Monitor: removing already scanned files from file list")
        for f in db_pathlist:
            if f in filelist:
                filelist.remove(f)
        db_pathlist = None

        self.setStatusDetail(u"Monitor: {0} new files to scan...".format(len(filelist)), logging.INFO)

        md_list = []
        self.read_count = 0
        for filename in filelist:
            md = self.getComicMetadata( filename )
            if md is not None:
                md_list.append(md)
            self.setStatusDetailOnly(u"Monitor: {0} files: {1} scanned, {2} added to library...".format(len(filelist), self.read_count,self.add_count))
            if self.quit:
                self.setStatusDetail(u"Monitor: halting scan!")
                return
            
            #every so often, commit to DB
            if self.read_count % 100 == 0 and self.read_count != 0:
                if len(md_list) > 0:
                    self.commitMetadataList(md_list)
                    md_list = []
        
        if len(md_list) > 0:
            self.commitMetadataList(md_list)
        
        self.setStatusDetail(u"Monitor: finished scanning metadata in {0} of {1} files".format(self.read_count,len(filelist)), logging.INFO)

 
        
        self.status = "IDLE"
        self.statusdetail = ""
        self.scancomplete_ts = int(time.mktime(datetime.utcnow().timetuple()) * 1000)
        
        logging.info("Monitor: Added {0} comics".format(self.add_count))
        logging.info("Monitor: Removed {0} comics".format(self.remove_count))
        
        if self.remove_count > 0 or self.add_count > 0:
            self.session.query(DatabaseInfo).first().last_updated = datetime.utcnow()
            self.session.commit()
            
        if self.quit_when_done:
            self.quit = True
dataset/ETHPy150Open beville/ComicStreamer/comicstreamerlib/monitor.py/Monitor.dofullScan/original