mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-06 13:47:59 +02:00
fix: compute repository size
This commit is contained in:
+7
-1
@@ -83,6 +83,7 @@ export default class Repository {
|
|||||||
const files = await this.source.getFiles();
|
const files = await this.source.getFiles();
|
||||||
this._model.originalFiles = files;
|
this._model.originalFiles = files;
|
||||||
this._model.size = 0;
|
this._model.size = 0;
|
||||||
|
await this.computeSize();
|
||||||
await this._model.save();
|
await this._model.save();
|
||||||
|
|
||||||
this._model.originalFiles = files;
|
this._model.originalFiles = files;
|
||||||
@@ -289,6 +290,11 @@ export default class Repository {
|
|||||||
return this._model.status;
|
return this._model.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get size() {
|
||||||
|
if (this._model.status != "ready") return 0;
|
||||||
|
return this._model.size;
|
||||||
|
}
|
||||||
|
|
||||||
toJSON() {
|
toJSON() {
|
||||||
return {
|
return {
|
||||||
repoId: this._model.repoId,
|
repoId: this._model.repoId,
|
||||||
@@ -299,7 +305,7 @@ export default class Repository {
|
|||||||
source: this.source.toJSON(),
|
source: this.source.toJSON(),
|
||||||
lastView: this._model.lastView,
|
lastView: this._model.lastView,
|
||||||
pageView: this._model.pageView,
|
pageView: this._model.pageView,
|
||||||
size: this._model.size,
|
size: this.size,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user