Skip to content

Commit

Permalink
Rory saves the day!
Browse files Browse the repository at this point in the history
  • Loading branch information
Pickysaurus committed Sep 23, 2024
1 parent b774a52 commit e3ffef9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/api/queries/v2-collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export async function collections(headers: Record<string,string>, filters: GQLTy
const baseURL = 'https://next.nexusmods.com/search-results/collections?';
const urlParams = new URLSearchParams();
urlParams.append('sortBy', variables.sortBy);
urlParams.append('adultContent', variables.filters.adultContent?.value === true ? '1' : '0' || '0');
urlParams.append('adultContent', variables.filters.adultContent?.value === true ? '1' : '0');
if (variables.filters.generalSearch) urlParams.append('keyword', variables.filters.generalSearch.value);
if (variables.filters.gameName) urlParams.append('gameName', variables.filters.gameName.value);
return `${baseURL}${urlParams.toString()}`;
Expand Down
16 changes: 11 additions & 5 deletions src/interactions/addmod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,17 @@ async function urlCheck(link: string, mods: NexusLinkedMod[], games: IGameStatic
/* eslint-disable strict-boolean-expressions */
if (modData.status !== "published") {
switch(modData.status) {
case('not_published'): throw new Error(`[Mod #${modId}](${url}) for ${game.name} is not published. Please publish it before adding it to your account.`);
case('hidden'): throw new Error(`[Mod #${modId}](${url}) for ${game.name} is hidden. Please unhide it before adding it to your account.`);
case('under_moderation'): throw new Error(`[Mod #${modId}](${url}) for ${game.name} has been locked by a moderator. Please contact the Nexus Mods team for further information.`);
case('wastebinned' || 'removed'): throw new Error(`[Mod #${modId}](${url}) for ${game.name} has been deleted and cannot be added to your account.`);
default: throw new Error(`[Mod #${modId}](${url}) for ${game.name} has a status of ${modData.status} and cannot be added to your account.`)
case('not_published'):
throw new Error(`[Mod #${modId}](${url}) for ${game.name} is not published. Please publish it before adding it to your account.`);
case('hidden'):
throw new Error(`[Mod #${modId}](${url}) for ${game.name} is hidden. Please unhide it before adding it to your account.`);
case('under_moderation'):
throw new Error(`[Mod #${modId}](${url}) for ${game.name} has been locked by a moderator. Please contact the Nexus Mods team for further information.`);
case('wastebinned'):
case('removed'):
throw new Error(`[Mod #${modId}](${url}) for ${game.name} has been deleted and cannot be added to your account.`);
default:
throw new Error(`[Mod #${modId}](${url}) for ${game.name} has a status of ${modData.status} and cannot be added to your account.`)
}
}
/* eslint-enable strict-boolean-expressions */
Expand Down

0 comments on commit e3ffef9

Please sign in to comment.