mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-05 06:41:13 +02:00
Save image size + start to automatic template creation based on image checksum.
This commit is contained in:
1 parent
f13b4e89b7
commit
078c42f185
7 files changed
+39
-9
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user