Commit 844803e6 authored by Dmitry Shelepnev's avatar Dmitry Shelepnev
Browse files

Replace bad_archive counter algoritm

parent a4c83766
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -70,8 +70,8 @@
      <file leaf-file-name="sopdscan.py" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/opds_catalog/sopdscan.py">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.6091954">
              <caret line="117" column="51" selection-start-line="117" selection-start-column="51" selection-end-line="117" selection-end-column="51" />
            <state vertical-scroll-proportion="0.5766283">
              <caret line="116" column="37" selection-start-line="116" selection-start-column="19" selection-end-line="116" selection-end-column="37" />
              <folding />
            </state>
          </provider>
@@ -1092,8 +1092,8 @@
    </entry>
    <entry file="file://$PROJECT_DIR$/opds_catalog/sopdscan.py">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.6091954">
          <caret line="117" column="51" selection-start-line="117" selection-start-column="51" selection-end-line="117" selection-end-column="51" />
        <state vertical-scroll-proportion="0.5766283">
          <caret line="116" column="37" selection-start-line="116" selection-start-column="19" selection-end-line="116" selection-end-column="37" />
          <folding />
        </state>
      </provider>
+4 −1
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ class opdsScanner:
        rel_file=os.path.relpath(file,settings.ROOT_LIB)
        if settings.ZIPRESCAN or (not opdsdb.zipisscanned(rel_file,1)):
            cat=opdsdb.addcattree(rel_file,1)
            zip_process_error = 0
            try:
                z = zipfile.ZipFile(file, 'r', allowZip64=True)
                filelist = z.namelist()
@@ -112,11 +113,13 @@ class opdsScanner:
                        self.processfile(n,file,z.open(n),cat,1,file_size)
                    except zipfile.BadZipFile:
                        self.logger.error('Error processing ZIP file = '+file+' book file = '+n)
                        zip_process_error = 1
                z.close()
                self.arch_scanned+=1
            except zipfile.BadZipFile:
                self.logger.error('Error while read ZIP archive. File '+file+' corrupt.')
                self.bad_archives+=1
                zip_process_error = 1
            self.bad_archives+=zip_process_error
        else:
            self.arch_skipped+=1
            self.logger.debug('Skip ZIP archive '+rel_file+'. Already scanned.')