fix(spr): remove redundant if/else block

we can just use the STOPPED value for the PL
This commit is contained in:
MiniBioOne 2025-03-25 08:57:07 +01:00
parent 6489084385
commit 78e87da468
2 changed files with 54 additions and 108 deletions

View File

@ -183,10 +183,6 @@ if (!config.spr.enabled) {
disabledFeatures.spr = true;
}
if (config.spr.enabled) {
disabledFeatures.spr = false;
}
if (disabledFeatures.s3) {
if (!config.cdn.disk_path) {
errors.push('s3 file storage is disabled and no CDN disk path was set. Set the PN_BOSS_CONFIG_CDN_DISK_PATH environment variable');

View File

@ -40,110 +40,60 @@ function get3DSPolicyList(countryCode: string, majorVersion: string): { PolicyLi
return null;
}
if (!disabledFeatures.spr) {
return {
PolicyList: {
MajorVersion: Number(majorVersion),
MinorVersion: 0,
ListId: 1891,
DefaultStop: false,
ForceVersionUp: false,
UpdateTime: moment().utc().format('YYYY-MM-DDTHH:MM:SS+0000'),
Priority: [
{
TitleId: '0004003000008f02',
TaskId: 'basho0',
Level: 'HIGH',
Persistent: true, // TODO - What's this?
Revive: true // TODO - What's this?
},
{
TitleId: '000400300000bc00',
TaskId: 'OlvNotf',
Level: 'HIGH',
Persistent: true, // TODO - What's this?
Revive: true // TODO - What's this?
},
{
TitleId: '000400300000bd00',
TaskId: 'OlvNotf',
Level: 'HIGH',
Persistent: true, // TODO - What's this?
Revive: true // TODO - What's this?
},
{
TitleId: '000400300000be00',
TaskId: 'OlvNotf',
Level: 'HIGH',
Persistent: true, // TODO - What's this?
Revive: true // TODO - What's this?
},
{
TitleId: '0004003000008f02',
TaskId: 'pl',
Level: 'HIGH',
Persistent: true, // TODO - What's this?
Revive: true // TODO - What's this?
},
{
TitleId: '0004013000003400',
TaskId: 'sprelay',
Level: 'HIGH',
Persistent: true, // TODO - What's this?
Revive: true // TODO - What's this?
}
]
}
};
} else {
return {
PolicyList: {
MajorVersion: Number(majorVersion),
MinorVersion: 0,
ListId: 1891,
DefaultStop: false,
ForceVersionUp: false,
UpdateTime: moment().utc().format('YYYY-MM-DDTHH:MM:SS+0000'),
Priority: [
{
TitleId: '0004003000008f02',
TaskId: 'basho0',
Level: 'HIGH',
Persistent: true, // TODO - What's this?
Revive: true // TODO - What's this?
},
{
TitleId: '000400300000bc00',
TaskId: 'OlvNotf',
Level: 'HIGH',
Persistent: true, // TODO - What's this?
Revive: true // TODO - What's this?
},
{
TitleId: '000400300000bd00',
TaskId: 'OlvNotf',
Level: 'HIGH',
Persistent: true, // TODO - What's this?
Revive: true // TODO - What's this?
},
{
TitleId: '000400300000be00',
TaskId: 'OlvNotf',
Level: 'HIGH',
Persistent: true, // TODO - What's this?
Revive: true // TODO - What's this?
},
{
TitleId: '0004003000008f02',
TaskId: 'pl',
Level: 'HIGH',
Persistent: true, // TODO - What's this?
Revive: true // TODO - What's this?
}
]
}
};
}
return {
PolicyList: {
MajorVersion: Number(majorVersion),
MinorVersion: 0,
ListId: 1891,
DefaultStop: false,
ForceVersionUp: false,
UpdateTime: moment().utc().format('YYYY-MM-DDTHH:MM:SS+0000'),
Priority: [
{
TitleId: '0004003000008f02',
TaskId: 'basho0',
Level: 'HIGH',
Persistent: true, // TODO - What's this?
Revive: true // TODO - What's this?
},
{
TitleId: '000400300000bc00',
TaskId: 'OlvNotf',
Level: 'HIGH',
Persistent: true, // TODO - What's this?
Revive: true // TODO - What's this?
},
{
TitleId: '000400300000bd00',
TaskId: 'OlvNotf',
Level: 'HIGH',
Persistent: true, // TODO - What's this?
Revive: true // TODO - What's this?
},
{
TitleId: '000400300000be00',
TaskId: 'OlvNotf',
Level: 'HIGH',
Persistent: true, // TODO - What's this?
Revive: true // TODO - What's this?
},
{
TitleId: '0004003000008f02',
TaskId: 'pl',
Level: 'HIGH',
Persistent: true, // TODO - What's this?
Revive: true // TODO - What's this?
},
{
TitleId: '0004013000003400',
TaskId: 'sprelay',
Level: disabledFeatures.spr ? 'STOPPED' : 'HIGH',
Persistent: true, // TODO - What's this?
Revive: true // TODO - What's this?
}
]
}
};
}
function getWiiUPolicyList(countryCode: string, majorVersion: string): { PolicyList: PolicyList } | null {