Added warning when submitting non-music category on music video.

Also added a color for the music category.
This commit is contained in:
Ajay Ramachandran
2020-05-10 18:48:28 -04:00
parent 52020bcac6
commit a335ae2b72
5 changed files with 21 additions and 4 deletions

View File

@@ -160,6 +160,18 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
ref.current.saveEditTimes();
}
// Check if any non music categories are being used on a music video
if (this.contentContainer().videoInfo.microformat.playerMicroformatRenderer.category === "Music") {
let sponsorTimesSubmitting = this.props.contentContainer().sponsorTimesSubmitting;
for (const sponsorTime of sponsorTimesSubmitting) {
if (!sponsorTime.category.startsWith("music_")) {
if (!confirm(chrome.i18n.getMessage("nonMusicCategoryOnMusic"))) return;
break;
}
}
}
this.props.callback();
this.cancel();