Save image size + start to automatic template creation based on image checksum.

This commit is contained in:
grossmj committed 2021-08-11 16:58:23 +09:30
1 parent f13b4e89b7
commit 078c42f185
7 files changed
+39 -9

No files matched your search

+2 -1
View File
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from sqlalchemy import Column, String, Integer
from sqlalchemy import Column, String, Integer, BigInteger
from sqlalchemy.orm import relationship
from .base import BaseTable
@@ -28,6 +28,7 @@ class Image(BaseTable):
id = Column(Integer, primary_key=True, autoincrement=True)
filename = Column(String, unique=True, index=True)
image_type = Column(String)
image_size = Column(BigInteger)
path = Column(String)
checksum = Column(String)
checksum_algorithm = Column(String)
+2 -1
View File
@@ -57,12 +57,13 @@ class ImagesRepository(BaseRepository):
result = await self._db_session.execute(query)
return result.scalars().first()
async def add_image(self, image_name, image_type, path, checksum, checksum_algorithm) -> models.Image:
async def add_image(self, image_name, image_type, image_size, path, checksum, checksum_algorithm) -> models.Image:
db_image = models.Image(
id=None,
filename=image_name,
image_type=image_type,
image_size=image_size,
path=path,
checksum=checksum,
checksum_algorithm=checksum_algorithm