From d2d7e4531dee7bc32522851b3e47d9dea2a530de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 24 Feb 2024 14:21:48 +0200 Subject: [PATCH 1/3] Add selftest method to Factory --- plextraktsync/util/Factory.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plextraktsync/util/Factory.py b/plextraktsync/util/Factory.py index ee634995d9..00d4c93abe 100644 --- a/plextraktsync/util/Factory.py +++ b/plextraktsync/util/Factory.py @@ -4,6 +4,19 @@ class Factory: + def selftest(self): + fail = 0 + # load every method from factory + for m in dir(self): + try: + getattr(self, m) + except Exception as e: + print(e) + fail += 1 + + if fail: + raise RuntimeError(f"Unpexpected {fail} methods failing") + def invalidate(self, keys: list[str] = None): """ Invalidate set of cached properties From 3cbdb2cff43d5a67f85b6e51083136a0cee5b289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 24 Feb 2024 14:22:10 +0200 Subject: [PATCH 2/3] Run selftest in info command --- plextraktsync/commands/info.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plextraktsync/commands/info.py b/plextraktsync/commands/info.py index 7ca2cc6639..6935a837dd 100644 --- a/plextraktsync/commands/info.py +++ b/plextraktsync/commands/info.py @@ -32,3 +32,6 @@ def info(print=factory.print): print(f"Enabled {len(sections.keys())} libraries in Plex Server:") for id, section in sorted(sections.items()): print(f" - {id}: {section.title_link}") + + # load every method from factory + factory.selftest() From 6c007e1ec9432852668030c828a6787eb7158c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 24 Feb 2024 14:23:15 +0200 Subject: [PATCH 3/3] Revert "Add sync/*.py exception in docker ignore (#1830)" This reverts commit 3a45a1011e67e67e8a9e3ee13dfe67afa9d34c84. --- .dockerignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index d197b68c28..4f3d6cc5e6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -16,7 +16,6 @@ !/plextraktsync/plex/*.py !/plextraktsync/queue/*.py !/plextraktsync/rich/*.py -!/plextraktsync/sync/*.py !/plextraktsync/trakt/*.py !/plextraktsync/util/*.py !/plextraktsync/watch/*.py