Get metadata from meta.json, if it exists #12

Merged
Toast merged 5 commits from localMetadata into main 2025-05-30 22:00:06 +02:00
2 changed files with 12 additions and 0 deletions
Showing only changes of commit bb858ef261 - Show all commits

View file

@ -41,6 +41,12 @@ class Mod:
else:
return self.__config.get("description", str)
@property
def long_description(self) -> str | None:
if "descriptionLong" in self.__meta:
return self.__meta.get("descriptionLong", str)
return None
@property
def author(self) -> str | None:
# TODO: return list with authors

View file

@ -9,6 +9,8 @@ QML_IMPORT_NAME = "Leek"
QML_IMPORT_MAJOR_VERSION = 1
# Qt follows C++ naming conventions
# ruff: noqa: N802
@QmlElement
@QmlUncreatable("QMod is intended to be returned by a QModListModel")
class QMod(QObject):
@ -34,6 +36,10 @@ class QMod(QObject):
def description(self) -> str | None:
return self.__mod.description
@Property(str, constant=True)
def longDescription(self) -> str | None:
return self.__mod.long_description
mod_enabled = Signal(name="enabled")
@Property(bool, notify=mod_enabled)