From 1acbfc727c53879cb4eb815d897913e92d291441 Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Mon, 28 Apr 2025 17:43:03 -0400 Subject: [PATCH] chore: update vocard 2.6.9 -> 2.7.1 Diff: https://github.com/ChocoMeow/Vocard/compare/refs/tags/v2.6.9...refs/tags/v2.7.1 --- .../services/vocard/_settings.nix | 2 +- packages/vocard/package.nix | 4 +-- packages/vocard/useLoadCredential.patch | 36 +++++++++---------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/nixosConfigurations/gerg-desktop/services/vocard/_settings.nix b/nixosConfigurations/gerg-desktop/services/vocard/_settings.nix index e0c73d6..cd0e0c8 100644 --- a/nixosConfigurations/gerg-desktop/services/vocard/_settings.nix +++ b/nixosConfigurations/gerg-desktop/services/vocard/_settings.nix @@ -142,5 +142,5 @@ spotify_client_id = p."vocard/spotify_client_id"; spotify_client_secret = p."vocard/spotify_client_secret"; token = p."vocard/token"; - version = "v2.6.9"; + version = "v2.7.1"; } diff --git a/packages/vocard/package.nix b/packages/vocard/package.nix index 3f07993..017bc05 100644 --- a/packages/vocard/package.nix +++ b/packages/vocard/package.nix @@ -6,7 +6,7 @@ makeBinaryWrapper, }: let - version = "2.6.9"; + version = "2.7.1"; python = python3.withPackages (p: [ p.discordpy p.motor @@ -26,7 +26,7 @@ stdenv.mkDerivation { owner = "ChocoMeow"; repo = "Vocard"; tag = "v${version}"; - hash = "sha256-21n+6LqXYVXc8ynS62IvWHxK76xxfatN8e99KDPueps="; + hash = "sha256-0cSR9z6JNB0xdHMyDrDRJQ7xilqGVifCowXuNKipgjQ="; }; buildPhase = '' diff --git a/packages/vocard/useLoadCredential.patch b/packages/vocard/useLoadCredential.patch index 32c90f4..d2e4602 100644 --- a/packages/vocard/useLoadCredential.patch +++ b/packages/vocard/useLoadCredential.patch @@ -1,9 +1,8 @@ - diff --git a/function.py b/function.py -index 6e09f5e..0c8bfa4 100644 +index e8fcae5..48057b6 100644 --- a/function.py +++ b/function.py -@@ -18,7 +18,7 @@ from motor.motor_asyncio import ( +@@ -41,7 +41,7 @@ from motor.motor_asyncio import ( ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -12,7 +11,7 @@ index 6e09f5e..0c8bfa4 100644 raise Exception("Settings file not set!") #--------------- Cache Var --------------- -@@ -52,7 +52,7 @@ ALLOWED_MENTIONS = discord.AllowedMentions().none() +@@ -85,7 +85,7 @@ class TempCtx(): #-------------- Vocard Functions -------------- def open_json(path: str) -> dict: try: @@ -21,16 +20,16 @@ index 6e09f5e..0c8bfa4 100644 return json.load(json_file) except: return {} -@@ -64,7 +64,7 @@ def update_json(path: str, new_data: dict) -> None: - - data.update(new_data) +@@ -97,7 +97,7 @@ def update_json(path: str, new_data: dict) -> None: + else: + data.update(new_data) - with open(os.path.join(ROOT_DIR, path), "w") as json_file: + with open(path, "w") as json_file: json.dump(data, json_file, indent=4) def langs_setup() -> None: -@@ -74,7 +74,7 @@ def langs_setup() -> None: +@@ -107,7 +107,7 @@ def langs_setup() -> None: for language in os.listdir(os.path.join(ROOT_DIR, "local_langs")): if language.endswith('.json'): @@ -39,7 +38,7 @@ index 6e09f5e..0c8bfa4 100644 return -@@ -130,7 +130,7 @@ def get_lang_non_async(guild_id: int, *keys) -> Union[list[str], str]: +@@ -163,7 +163,7 @@ def get_lang_non_async(guild_id: int, *keys) -> Union[list[str], str]: settings = SETTINGS_BUFFER.get(guild_id, {}) lang = settings.get("lang", "EN") if lang in LANGS and not LANGS[lang]: @@ -48,7 +47,7 @@ index 6e09f5e..0c8bfa4 100644 if len(keys) == 1: return LANGS.get(lang, {}).get(keys[0], "Language pack not found!") -@@ -147,7 +147,7 @@ async def get_lang(guild_id:int, *keys) -> Union[list[str], str]: +@@ -180,7 +180,7 @@ async def get_lang(guild_id:int, *keys) -> Optional[Union[list[str], str]]: settings = await get_settings(guild_id) lang = settings.get("lang", "EN") if lang in LANGS and not LANGS[lang]: @@ -56,28 +55,28 @@ index 6e09f5e..0c8bfa4 100644 + LANGS[lang] = open_json(os.path.join(ROOT_DIR, "langs", f"{lang}.json")) if len(keys) == 1: - return LANGS.get(lang, {}).get(keys[0], "Language pack not found!") + return LANGS.get(lang, {}).get(keys[0]) diff --git a/main.py b/main.py -index e2c6b9e..98dc34b 100644 +index 202db23..f486658 100644 --- a/main.py +++ b/main.py -@@ -80,13 +80,7 @@ class Vocard(commands.Bot): +@@ -138,13 +138,7 @@ class Vocard(commands.Bot): await self.ipc.connect() except Exception as e: func.logger.error(f"Cannot connected to dashboard! - Reason: {e}") - - if not func.settings.version or func.settings.version != update.__version__: -- func.update_json("settings.json", new_data={"version": update.__version__}) -- -- await self.tree.set_translator(Translator()) - await self.tree.sync() +- func.update_json("settings.json", new_data={"version": update.__version__}) +- for locale_key, values in func.MISSING_TRANSLATOR.items(): +- func.logger.warning(f'Missing translation for "{", ".join(values)}" in "{locale_key}"') - + await self.tree.sync() async def on_ready(self): func.logger.info("------------------") func.logger.info(f"Logging As {self.user}") -@@ -144,7 +138,7 @@ async def get_prefix(bot, message: discord.Message): - return settings.get("prefix", func.settings.bot_prefix) +@@ -209,7 +203,7 @@ async def get_prefix(bot: commands.Bot, message: discord.Message) -> str: + return prefix # Loading settings and logger -func.settings = Settings(func.open_json("settings.json")) @@ -85,3 +84,4 @@ index e2c6b9e..98dc34b 100644 LOG_SETTINGS = func.settings.logging if (LOG_FILE := LOG_SETTINGS.get("file", {})).get("enable", True): +