mirror of https://github.com/borgbase/vorta
Extend snapshot Model.
This commit is contained in:
parent
da4b9dbbed
commit
dc2a156855
|
@ -96,7 +96,6 @@ class BorgThread(QtCore.QThread, BackupProfileMixin):
|
|||
self.result.emit(result)
|
||||
self.mutex.unlock()
|
||||
|
||||
|
||||
def process_create_result(self, result):
|
||||
if result['returncode'] == 0:
|
||||
new_snapshot, created = SnapshotModel.get_or_create(
|
||||
|
@ -104,7 +103,9 @@ class BorgThread(QtCore.QThread, BackupProfileMixin):
|
|||
defaults={
|
||||
'name': result['data']['archive']['name'],
|
||||
'time': parser.parse(result['data']['archive']['start']),
|
||||
'repo': self.profile.repo
|
||||
'repo': self.profile.repo,
|
||||
'duration': result['data']['archive']['duration'],
|
||||
'size': result['data']['archive']['stats']['deduplicated_size']
|
||||
}
|
||||
)
|
||||
new_snapshot.save()
|
||||
|
|
|
@ -78,6 +78,8 @@ class SnapshotModel(peewee.Model):
|
|||
name = peewee.CharField()
|
||||
repo = peewee.ForeignKeyField(RepoModel, backref='snapshots')
|
||||
time = peewee.DateTimeField()
|
||||
duration = peewee.FloatField(null=True)
|
||||
size = peewee.IntegerField(null=True)
|
||||
|
||||
def formatted_time(self):
|
||||
return
|
||||
|
|
|
@ -45,8 +45,6 @@ app = BUNDLE(exe,
|
|||
'CFBundleShortVersionString': '0.2.0'
|
||||
},
|
||||
)
|
||||
|
||||
# Debug package. (inspired by borg-spec)
|
||||
if False:
|
||||
coll = COLLECT(exe,
|
||||
a.binaries,
|
||||
|
|
Loading…
Reference in New Issue