Compare commits

...

4 Commits
3.3 ... 3.3.1

Author SHA1 Message Date
Ajay Ramachandran
028374e62d Update manifest.json 2021-10-02 14:38:59 -04:00
Ajay Ramachandran
dc1e5ce762 Fix styling on voting wrong category 2021-10-01 18:28:11 -04:00
Ajay Ramachandran
8fcf8ac46c Speed up autohiding button transition 2021-10-01 18:08:02 -04:00
Ajay Ramachandran
ef70e71051 Fix segments not appearing when loaded early 2021-10-01 18:07:15 -04:00
5 changed files with 12 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
"version": "3.3",
"version": "3.3.1",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",

View File

@@ -82,13 +82,13 @@
.autoHiding:not(.hidden) {
transform: translateX(0%) scale(1);
/* opacity is from YouTube page */
transition: transform 0.25s, width 0.25s, opacity .1s cubic-bezier(0.4,0.0,1,1) !important;
transition: transform 0.2s, width 0.2s, opacity .1s cubic-bezier(0.4,0.0,1,1) !important;
}
.autoHiding.hidden {
transform: translateX(100%) scale(0);
/* opacity is from YouTube page */
transition: transform 0.25s, width 0.25s, opacity .1s cubic-bezier(0.4,0.0,1,1) !important;
transition: transform 0.2s, width 0.2s, opacity .1s cubic-bezier(0.4,0.0,1,1) !important;
width: 0px !important;
}

View File

@@ -266,7 +266,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
<td>
{/* Category Selector */}
<select id={"sponsorTimeCategories" + this.idSuffix}
className="sponsorTimeCategories"
className="sponsorTimeCategories sponsorTimeEditSelector"
defaultValue={this.segments[0].category} //Just default to the first segment, as we don't know which they'll choose
ref={this.categoryOptionRef}>

View File

@@ -386,6 +386,12 @@ function createPreviewBar(): void {
function durationChangeListener(): void {
updateAdFlag();
updatePreviewBar();
sponsorTimes = sponsorTimes.filter(segmentDurationFilter);
}
function segmentDurationFilter(segment: SponsorTime): boolean {
return segment.videoDuration === 0 || video.duration === 0 || Math.abs(video.duration - segment.videoDuration) < 2;
}
function cancelSponsorSchedule(): void {
@@ -669,7 +675,7 @@ async function sponsorsLookup(id: string, keepOldSubmissions = true) {
const recievedSegments: SponsorTime[] = JSON.parse(response.responseText)
?.filter((video) => video.videoID === id)
?.map((video) => video.segments)[0]
?.filter((segment) => segment.videoDuration === 0 || Math.abs(video.duration - segment.videoDuration) < 2);
?.filter(segmentDurationFilter);
if (!recievedSegments || !recievedSegments.length) {
// return if no video found
retryFetch();

View File

@@ -80,6 +80,7 @@ export interface SponsorTime {
hidden?: SponsorHideType;
source?: SponsorSourceType;
videoDuration?: number;
}
export interface ScheduledTime extends SponsorTime {