mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-12-19 13:36:59 +01:00
Android: add Shortcut & Wallpaper menu to Game Card's context menu
This commit is contained in:
@@ -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};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user