Skip to content

Commit

Permalink
Adds YouTube triplet privacy setting PR #414
Browse files Browse the repository at this point in the history
Merge pull request #414 from kendraio/youtube-privacy-setting, completes issue #415
  • Loading branch information
lukestanley committed Nov 28, 2023
2 parents b0b9695 + 4c63098 commit 2d72bee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@

<input type="file" placeholder="Select file" (change)="onFileChange($event)">

<mat-checkbox formControlName="isPrivate">Private</mat-checkbox>
<mat-radio-group formControlName="privacySetting">
<mat-radio-button value="private">Private</mat-radio-button>
<mat-radio-button value="public">Public</mat-radio-button>
<mat-radio-button value="unlisted">Unlisted</mat-radio-button>
</mat-radio-group>
</form>
</ng-container>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class YoutubeUploadComponent implements OnInit {
description: ['', [Validators.required]],
category: ['', [Validators.required]],
file: [null, [Validators.required]],
isPrivate: [true]
privacySetting: ['unlisted', [Validators.required]]
});
this.categories$ = this.yt.getCategories();
this.progress$ = this.yt.progress$;
Expand Down
7 changes: 3 additions & 4 deletions src/app/services/youtube-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ export class YoutubeDataService {
);
}

uploadVideo({ title, description, category, file, isPrivate}) {
console.log({ title, description, category, file, isPrivate});
uploadVideo({ title, description, category, file, privacySetting}) {
console.log({ title, description, category, file, privacySetting});
const url = 'https://www.googleapis.com/upload/youtube/v3/videos';
this.getAccessToken().pipe(
switchMap(access_token => {
Expand All @@ -171,8 +171,7 @@ export class YoutubeDataService {
categoryId: category
},
status: {
// TODO: Always private for testing
privacyStatus: isPrivate ? 'private' : 'private'
privacyStatus: privacySetting
}
}, {
params: {
Expand Down

1 comment on commit 2d72bee

@vercel
Copy link

@vercel vercel bot commented on 2d72bee Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kendraio-app – ./

kendraio-app-git-develop-kendraio.vercel.app
kendraio-app-kendraio.vercel.app

Please sign in to comment.