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

@@ -567,5 +567,8 @@
},
"incorrectCategory": {
"message": "Wrong Category"
},
"nonMusicCategoryOnMusic": {
"message": "This video is categorized as music. Are you sure you would like to submit segments with non-music categories? Unless this video is not actually music, you should not be submitting this segment. Please read the guidelines if you are confused."
}
}

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();

View File

@@ -114,7 +114,8 @@ var skipNoticeContentContainer: ContentContainer = () => ({
sponsorSubmissionNotice: submissionNotice,
resetSponsorSubmissionNotice,
changeStartSponsorButton,
previewTime
previewTime,
videoInfo
});
//get messages from the background script and the popup

View File

@@ -50,11 +50,11 @@ let barTypes = {
color: "#bfbf35",
opacity: "0.7"
},
"offtopic": {
"music_offtopic": {
color: "#ff9900",
opacity: "0.7"
},
"preview-offtopic": {
"preview-music_offtopic": {
color: "#a6634a",
opacity: "0.7"
}

View File

@@ -16,7 +16,8 @@ interface ContentContainer {
sponsorSubmissionNotice: SubmissionNotice,
resetSponsorSubmissionNotice: () => void,
changeStartSponsorButton: (showStartSponsor: any, uploadButtonVisible: any) => Promise<boolean>,
previewTime: (time: number) => void
previewTime: (time: number) => void,
videoInfo: any
}
}