Skip to content

Commit

Permalink
Fix problem with "|" character in game title
Browse files Browse the repository at this point in the history
  • Loading branch information
redphx committed Sep 4, 2024
1 parent 8d44dab commit e952bf0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { BxLogger } from "@utils/bx-logger";
import { GameBar } from "./modules/game-bar/game-bar";
import { Screenshot } from "./utils/screenshot";
import { NativeMkbHandler } from "./modules/mkb/native-mkb-handler";
import { GuideMenu, GuideMenuTab } from "./modules/ui/guide-menu";
import { GuideMenu } from "./modules/ui/guide-menu";
import { updateVideoPlayer } from "./modules/stream/stream-settings-utils";
import { UiSection } from "./enums/ui-sections";
import { HeaderSection } from "./modules/ui/header";
Expand All @@ -40,7 +40,6 @@ import { SettingsNavigationDialog } from "./modules/ui/dialog/settings-dialog";
import { StreamUiHandler } from "./modules/stream/stream-ui";
import { UserAgent } from "./utils/user-agent";
import { XboxApi } from "./utils/xbox-api";
import { TrueAchievements } from "./utils/true-achievements";


// Handle login page
Expand Down
2 changes: 1 addition & 1 deletion src/modules/ui/product-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class ProductDetailsPage {
return;
}

const titleSlug = matches.groups.titleSlug;
const titleSlug = matches.groups.titleSlug.replaceAll('\%' + '7C', '-');
const productId = matches.groups.productId;
AppInterface.downloadWallpapers(titleSlug, productId);
} catch (e) {}
Expand Down
1 change: 1 addition & 0 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export async function copyToClipboard(text: string, showToast=true): Promise<boo

export function productTitleToSlug(title: string): string {
return title.replace(/[;,/?:@&=+_`~$%#^*()!^\u2122\xae\xa9]/g, '')
.replace(/\|/g, '-')
.replace(/ {2,}/g, ' ')
.trim()
.substr(0, 50)
Expand Down

0 comments on commit e952bf0

Please sign in to comment.