mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 02:42:45 +00:00
disable download mode for the moment
This commit is contained in:
@@ -56,8 +56,8 @@ export default class Repository {
|
||||
this._model = data;
|
||||
switch (data.source.type) {
|
||||
case "GitHubDownload":
|
||||
this.source = new GitHubDownload(data.source, this);
|
||||
break;
|
||||
// this.source = new GitHubDownload(data.source, this);
|
||||
// break;
|
||||
case "GitHubStream":
|
||||
this.source = new GitHubStream(data.source, this);
|
||||
break;
|
||||
|
||||
@@ -468,28 +468,29 @@ router.post("/", async (req: express.Request, res: express.Response) => {
|
||||
repo.owner = user.id;
|
||||
|
||||
updateRepoModel(repo, repoUpdate);
|
||||
repo.source.type = "GitHubStream";
|
||||
repo.source.accessToken = user.accessToken;
|
||||
repo.source.repositoryId = repository.model.id;
|
||||
repo.source.repositoryName = repoUpdate.fullName;
|
||||
|
||||
if (repo.source.type == "GitHubDownload") {
|
||||
// details.size is in kilobytes
|
||||
if (
|
||||
repository.size === undefined ||
|
||||
repository.size > config.MAX_REPO_SIZE
|
||||
) {
|
||||
throw new AnonymousError("invalid_mode", {
|
||||
object: repository,
|
||||
httpStatus: 400,
|
||||
});
|
||||
}
|
||||
}
|
||||
if (
|
||||
repository.size !== undefined &&
|
||||
repository.size < config.AUTO_DOWNLOAD_REPO_SIZE
|
||||
) {
|
||||
repo.source.type = "GitHubDownload";
|
||||
}
|
||||
// if (repo.source.type === "GitHubDownload") {
|
||||
// // details.size is in kilobytes
|
||||
// if (
|
||||
// repository.size === undefined ||
|
||||
// repository.size > config.MAX_REPO_SIZE
|
||||
// ) {
|
||||
// throw new AnonymousError("invalid_mode", {
|
||||
// object: repository,
|
||||
// httpStatus: 400,
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// if (
|
||||
// repository.size !== undefined &&
|
||||
// repository.size < config.AUTO_DOWNLOAD_REPO_SIZE
|
||||
// ) {
|
||||
// repo.source.type = "GitHubDownload";
|
||||
// }
|
||||
repo.conference = repoUpdate.conference;
|
||||
|
||||
await repo.save();
|
||||
|
||||
@@ -91,7 +91,7 @@ export default class GitHubDownload extends GitHubBase implements SourceBase {
|
||||
|
||||
const that = this;
|
||||
async function updateProgress() {
|
||||
if (progress && that.repository.status) {
|
||||
if (progress && that.repository.status == RepositoryStatus.DOWNLOAD) {
|
||||
await that.repository.updateStatus(
|
||||
that.repository.status,
|
||||
progress.transferred.toString()
|
||||
|
||||
Reference in New Issue
Block a user