feat: youtube made for kids
This commit is contained in:
parent
4aa5f7b144
commit
33255d7796
|
|
@ -25,6 +25,17 @@ const type = [
|
|||
value: 'unlisted',
|
||||
},
|
||||
];
|
||||
|
||||
const madeForKids = [
|
||||
{
|
||||
label: 'No',
|
||||
value: 'no',
|
||||
},
|
||||
{
|
||||
label: 'Yes',
|
||||
value: 'yes',
|
||||
},
|
||||
];
|
||||
const YoutubeSettings: FC = () => {
|
||||
const { register, control } = useSettings();
|
||||
return (
|
||||
|
|
@ -42,6 +53,18 @@ const YoutubeSettings: FC = () => {
|
|||
</option>
|
||||
))}
|
||||
</Select>
|
||||
<Select
|
||||
label="Made for kids"
|
||||
{...register('selfDeclaredMadeForKids', {
|
||||
value: 'no',
|
||||
})}
|
||||
>
|
||||
{madeForKids.map((t) => (
|
||||
<option key={t.value} value={t.value}>
|
||||
{t.label}
|
||||
</option>
|
||||
))}
|
||||
</Select>
|
||||
<MediumTags label="Tags" {...register('tags')} />
|
||||
<div className="mt-[20px]">
|
||||
<MediaComponent
|
||||
|
|
|
|||
|
|
@ -23,6 +23,10 @@ export class YoutubeSettingsDto {
|
|||
@IsDefined()
|
||||
type: string;
|
||||
|
||||
@IsIn(['yes', 'no'])
|
||||
@IsOptional()
|
||||
selfDeclaredMadeForKids: 'no' | 'yes';
|
||||
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => MediaDto)
|
||||
|
|
|
|||
|
|
@ -48,9 +48,7 @@ const clientAndYoutube = () => {
|
|||
return { client, youtube, oauth2, youtubeAnalytics };
|
||||
};
|
||||
|
||||
@Rules(
|
||||
'YouTube must have on video attachment, it cannot be empty'
|
||||
)
|
||||
@Rules('YouTube must have on video attachment, it cannot be empty')
|
||||
export class YoutubeProvider extends SocialAbstract implements SocialProvider {
|
||||
override maxConcurrentJob = 1; // YouTube has strict upload quotas
|
||||
identifier = 'youtube';
|
||||
|
|
@ -225,6 +223,8 @@ export class YoutubeProvider extends SocialAbstract implements SocialProvider {
|
|||
},
|
||||
status: {
|
||||
privacyStatus: settings.type,
|
||||
selfDeclaredMadeForKids:
|
||||
settings.selfDeclaredMadeForKids === 'yes',
|
||||
},
|
||||
},
|
||||
media: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue