Hash and track layer file chunks for torrenting
This commit is contained in:
parent
40c741f34e
commit
fe87d3c796
8 changed files with 115 additions and 10 deletions
|
@ -5,7 +5,7 @@ from peewee import JOIN_LEFT_OUTER, fn, SQL
|
|||
from data.model import config, db_transaction, InvalidImageException
|
||||
from data.database import (ImageStorage, Image, DerivedStorageForImage, ImageStoragePlacement,
|
||||
ImageStorageLocation, ImageStorageTransformation, ImageStorageSignature,
|
||||
ImageStorageSignatureKind, Repository, Namespace)
|
||||
ImageStorageSignatureKind, Repository, Namespace, TorrentInfo)
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -212,3 +212,7 @@ def get_storage_locations(uuid):
|
|||
.where(ImageStorage.uuid == uuid))
|
||||
|
||||
return [location.location.name for location in query]
|
||||
|
||||
|
||||
def save_torrent_info(storage_object, piece_length, pieces):
|
||||
TorrentInfo.create(storage=storage_object, piece_length=piece_length, pieces=pieces)
|
||||
|
|
Reference in a new issue