mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 20:17:05 +03:00
Added warning when submitting non-music category on music video.
Also added a color for the music category.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user