Proper game_id for desktop entries
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import shlex
|
import shlex
|
||||||
|
from hashlib import sha3_256
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from time import time
|
from time import time
|
||||||
from typing import NamedTuple
|
from typing import NamedTuple
|
||||||
@@ -113,7 +114,10 @@ class DesktopSourceIterable(SourceIterable):
|
|||||||
"source": self.source.source_id,
|
"source": self.source.source_id,
|
||||||
"added": added_time,
|
"added": added_time,
|
||||||
"name": name,
|
"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(
|
"executable": self.source.executable_format.format(
|
||||||
exec=cd_path
|
exec=cd_path
|
||||||
+ (
|
+ (
|
||||||
|
|||||||
@@ -156,9 +156,9 @@ class CartridgesApplication(Adw.Application):
|
|||||||
def on_about_action(self, *_args: Any) -> None:
|
def on_about_action(self, *_args: Any) -> None:
|
||||||
# Get the debug info from the log files
|
# Get the debug info from the log files
|
||||||
debug_str = ""
|
debug_str = ""
|
||||||
for i, path in enumerate(shared.log_files):
|
for index, path in enumerate(shared.log_files):
|
||||||
# Add a horizontal line between runs
|
# Add a horizontal line between runs
|
||||||
if i > 0:
|
if index > 0:
|
||||||
debug_str += "─" * 37 + "\n"
|
debug_str += "─" * 37 + "\n"
|
||||||
# Add the run's logs
|
# Add the run's logs
|
||||||
log_file = (
|
log_file = (
|
||||||
|
|||||||
Reference in New Issue
Block a user