Proper game_id for desktop entries

This commit is contained in:
kramo
2023-08-21 15:23:29 +02:00
parent 2d791e46b0
commit 1e2d85b50d
2 changed files with 7 additions and 3 deletions

View File

@@ -18,6 +18,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
import shlex
from hashlib import sha3_256
from pathlib import Path
from time import time
from typing import NamedTuple
@@ -113,7 +114,10 @@ class DesktopSourceIterable(SourceIterable):
"source": self.source.source_id,
"added": added_time,
"name": name,
"game_id": "desktop" + executable.replace(" ", "_"),
"game_id": "desktop_"
+ sha3_256(
str(path).encode("utf-8"), usedforsecurity=False
).hexdigest(),
"executable": self.source.executable_format.format(
exec=cd_path
+ (