Android: add Shortcut & Wallpaper menu to Game Card's context menu

This commit is contained in:
redphx
2024-10-19 16:53:55 +07:00
parent 63aaca7d61
commit 03efa528c8
4 changed files with 132 additions and 61 deletions

View File

@@ -120,3 +120,15 @@ export function productTitleToSlug(title: string): string {
.replace(/ /g, '-')
.toLowerCase();
}
export function parseDetailsPath(path: string) {
const matches = /\/games\/(?<titleSlug>[^\/]+)\/(?<productId>\w+)/.exec(path);
if (!matches?.groups) {
return;
}
const titleSlug = matches.groups.titleSlug.replaceAll('\%' + '7C', '-');
const productId = matches.groups.productId;
return {titleSlug, productId};
}