Skip to content

Commit

Permalink
Merge pull request #35 from KTachibanaM/s3-v0
Browse files Browse the repository at this point in the history
Serving Albireo resources from blob storage v0/PoC
  • Loading branch information
EverettSummer authored May 31, 2024
2 parents 2da378a + 7dfa4e0 commit 2a5b74c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export class VideoFileModal implements OnInit, OnDestroy {
DOWNLOADED: VideoFile.STATUS_DOWNLOADED
};

enableBlobStorageOptions = false;

constructor(private _dialogRef: UIDialogRef<VideoFileModal>,
private _adminService: AdminService,
private _fb: FormBuilder,
Expand Down Expand Up @@ -130,7 +132,8 @@ export class VideoFileModal implements OnInit, OnDestroy {
resolution_w: null,
resolution_h: null,
duration: null,
label: null
label: null,
blob_storage_url_v0: '',
});
this.videoFileList.unshift(videoFileFormGroup);
}
Expand Down Expand Up @@ -158,7 +161,8 @@ export class VideoFileModal implements OnInit, OnDestroy {
resolution_w: videoFile.resolution_w,
resolution_h: videoFile.resolution_h,
duration: videoFile.duration,
label: videoFile.label
label: videoFile.label,
blob_storage_url_v0: videoFile.blob_storage_url_v0,
}));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,25 @@ <h4 class="ui horizontal divider header">
<div class="three fields">
<div class="field">
<label>resolution_w</label>
<input type="text" formControlName="resolution_w" readonly>
<input type="text" formControlName="resolution_w" [readonly]="!enableBlobStorageOptions">
</div>
<div class="field">
<label>resolution_h</label>
<input type="text" formControlName="resolution_h" readonly>
<input type="text" formControlName="resolution_h" [readonly]="!enableBlobStorageOptions">
</div>
<div class="field">
<label>duration</label>
<input type="text" formControlName="duration" readonly>
<input type="text" formControlName="duration" [readonly]="!enableBlobStorageOptions">
</div>
</div>
<div class="field">
<label>download_url</label>
<input type="text" placeholder="magnet或torrent文件的url" formControlName="download_url">
</div>
<div class="field" *ngIf="enableBlobStorageOptions">
<label>blob_storage_url_v0</label>
<input type="text" placeholder="S3 存储 URL" formControlName="blob_storage_url_v0">
</div>
<div class="inline fields">
<label>状态</label>
<div class="field">
Expand Down Expand Up @@ -94,6 +98,7 @@ <h4 class="ui horizontal divider header">
</form>
</div>
<div class="footer">
<ui-toggle text="(测试) 开启 S3 存储选项" [(ngModel)]="enableBlobStorageOptions"></ui-toggle>
<p><i class="help circle icon"></i>替换已完成或下载中的VideoFile的方法,先删除要替换的VideoFile在新建VideoFile</p>
</div>
</div>
2 changes: 1 addition & 1 deletion src/app/entity/video-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class VideoFile {
kf_frame_width?: number;
kf_frame_height?: number;
kf_image_path_list?: string;

blob_storage_url_v0?: string;

static STATUS_DOWNLOAD_PENDING = 1;
static STATUS_DOWNLOADING = 2;
Expand Down

0 comments on commit 2a5b74c

Please sign in to comment.