def getComicMetadata(self, path):
        # TODO: Need to fix the default image path
        print(path)
        ca = ComicArchive(path, default_image_path=None)
        if ca.seemsToBeAComicArchive():

            self.logger.info(f"Reading in {self.read_count} {path}")
            self.read_count += 1
            if ca.hasMetadata(MetaDataStyle.CIX):

                style = MetaDataStyle.CIX
            else:
                style = None

            if style is not None:

                md = ca.readMetadata(style)
                md.path = ca.path

                md.page_count = ca.page_count
                md.mod_ts = datetime.utcfromtimestamp(os.path.getmtime(
                    ca.path))

                return md
        return None
예제 #2
0
 def test_seems_to_be_comic_archive_zip(self):
     ca = ComicArchive(TEST_DATA)
     z = ca.seemsToBeAComicArchive()
     self.assertTrue(z)