Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporarily disable optimizer. #4671

Merged
merged 3 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions app/components-react/windows/settings/General.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,17 @@ function ExtraSettings() {
isDualOutputScene: DualOutputService.views.hasNodeMap(),
}));

const canRunOptimizer =
// HDR Settings are not compliant with the auto-optimizer
!SettingsService.views.hasHDRSettings &&
isTwitch &&
!isRecordingOrStreaming &&
protectedMode &&
isSimpleOutputMode;
/**
* Temporarily disable optimizer until migrated to the new API
*/
const canRunOptimizer = false;
// const canRunOptimizer =
// HDR Settings are not compliant with the auto-optimizer
// !SettingsService.views.hasHDRSettings &&
// isTwitch &&
// !isRecordingOrStreaming &&
// protectedMode &&
// isSimpleOutputMode;

function restartStreamlabelsSession() {
StreamlabelsService.restartSession().then(result => {
Expand Down
75 changes: 40 additions & 35 deletions app/services/auto-config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,43 +32,48 @@ export class AutoConfigService extends Service {
configProgress = new Subject<IConfigProgress>();

async start() {
try {
if (this.userService.views.isTwitchAuthed) {
const service = getPlatformService('twitch') as TwitchService;
const key = await service.fetchStreamKey();
this.streamSettingsService.setSettings({ key, platform: 'twitch' });
} else if (this.userService.views.isYoutubeAuthed) {
const service = getPlatformService('youtube') as YoutubeService;
await service.beforeGoLive({
platforms: {
youtube: {
enabled: true,
useCustomFields: false,
title: 'bandwidthTest',
description: 'bandwidthTest',
privacyStatus: 'private',
categoryId: '1',
},
},
advancedMode: true,
customDestinations: [],
});
}
} catch (e: unknown) {
console.error('Failure fetching stream key for auto config');
this.handleProgress({ event: 'error', description: 'error_fetching_stream_key' });
return;
}
/**
* Temporarily disable optimizer until migrated to the new API
*/
return;

obs.NodeObs.InitializeAutoConfig(
(progress: IConfigProgress) => {
this.handleProgress(progress);
this.configProgress.next(progress);
},
{ continent: '', service_name: '' },
);
// try {
// if (this.userService.views.isTwitchAuthed) {
// const service = getPlatformService('twitch') as TwitchService;
// const key = await service.fetchStreamKey();
// this.streamSettingsService.setSettings({ key, platform: 'twitch' });
// } else if (this.userService.views.isYoutubeAuthed) {
// const service = getPlatformService('youtube') as YoutubeService;
// await service.beforeGoLive({
// platforms: {
// youtube: {
// enabled: true,
// useCustomFields: false,
// title: 'bandwidthTest',
// description: 'bandwidthTest',
// privacyStatus: 'private',
// categoryId: '1',
// },
// },
// advancedMode: true,
// customDestinations: [],
// });
// }
// } catch (e: unknown) {
// console.error('Failure fetching stream key for auto config');
// this.handleProgress({ event: 'error', description: 'error_fetching_stream_key' });
// return;
// }

// obs.NodeObs.InitializeAutoConfig(
// (progress: IConfigProgress) => {
// this.handleProgress(progress);
// this.configProgress.next(progress);
// },
// { continent: '', service_name: '' },
// );

obs.NodeObs.StartBandwidthTest();
// obs.NodeObs.StartBandwidthTest();
}

async startRecording() {
Expand Down
24 changes: 14 additions & 10 deletions app/services/onboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,14 @@ export const ONBOARDING_STEPS = () => ({
hideButton: true,
label: $t('Add a Theme'),
},
[EOnboardingSteps.Optimize]: {
component: 'Optimize',
disableControls: false,
hideSkip: false,
hideButton: true,
label: $t('Optimize'),
},
// Temporarily skip auto config until migration to new API
// [EOnboardingSteps.Optimize]: {
// component: 'Optimize',
// disableControls: false,
// hideSkip: false,
// hideButton: true,
// label: $t('Optimize'),
// },
[EOnboardingSteps.Prime]: {
component: 'Prime',
disableControls: false,
Expand Down Expand Up @@ -193,9 +194,12 @@ class OnboardingViews extends ViewHandler<IOnboardingServiceState> {
steps.push(ONBOARDING_STEPS()[EOnboardingSteps.ThemeSelector]);
}

if (userViews.isTwitchAuthed || userViews.isYoutubeAuthed || recordingModeEnabled) {
steps.push(ONBOARDING_STEPS()[EOnboardingSteps.Optimize]);
}
/**
* Temporarily disable optimizer until migrated to the new API
*/
// if (userViews.isTwitchAuthed || userViews.isYoutubeAuthed || recordingModeEnabled) {
// steps.push(ONBOARDING_STEPS()[EOnboardingSteps.Optimize]);
// }

if (!userViews.isPrime) {
steps.push(ONBOARDING_STEPS()[EOnboardingSteps.Prime]);
Expand Down
5 changes: 3 additions & 2 deletions test/regular/obs-importer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ test('OBS Importer', async t => {
await click('div=Import from OBS Studio');
await click('div=Start');

await waitForDisplayed('h1=Optimize');
await (await t.context.app.client.$('button=Skip')).click();
// Temporarily skip auto config test until migration to new API
// await waitForDisplayed('h1=Optimize');
// await (await t.context.app.client.$('button=Skip')).click();
await (await t.context.app.client.$('div=Choose Starter')).click();

await waitForDisplayed('[data-name=SceneSelector]');
Expand Down
5 changes: 3 additions & 2 deletions test/regular/onboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ test('Go through the onboarding and autoconfig', async t => {
await sleep(1000);
}

// Temporarily skip auto config test until migration to new API
// Start auto config
t.true(await (await app.client.$('button=Start')).isExisting());
await (await app.client.$('button=Start')).click();
// t.true(await (await app.client.$('button=Start')).isExisting());
// await (await app.client.$('button=Start')).click();

await (await t.context.app.client.$('div=Choose Starter')).waitForDisplayed({ timeout: 60000 });
// Skip purchasing prime
Expand Down
11 changes: 6 additions & 5 deletions test/screentest/tests/onboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ test('Onboarding steps', async t => {
await makeScreenshots(t, 'Add a Theme');
await (await app.client.$('button=Skip')).click();

await (await app.client.$('h1=Optimize')).waitForDisplayed();
await makeScreenshots(t, 'Before optimize');
await (await app.client.$('button=Start')).click();
await (await app.client.$('h1=Optimizing... 33%')).waitForDisplayed();
await makeScreenshots(t, 'Optimization progress');
// Temporarily skip auto config test until migration to new API
// await (await app.client.$('h1=Optimize')).waitForDisplayed();
// await makeScreenshots(t, 'Before optimize');
// await (await app.client.$('button=Start')).click();
// await (await app.client.$('h1=Optimizing... 33%')).waitForDisplayed();
// await makeScreenshots(t, 'Optimization progress');

await (await app.client.$('h1=Choose your Streamlabs plan')).waitForDisplayed({ timeout: 15000 });
await makeScreenshots(t, 'Ultra');
Expand Down
Loading