From 21cf1be32611c173bbba8670d9fa2d4d6983e88b Mon Sep 17 00:00:00 2001 From: omicron Date: Thu, 25 Sep 2025 20:53:11 +0200 Subject: [PATCH 1/4] Fix crash when zombie processes exist in the psutil result --- d2warehouse/app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d2warehouse/app/main.py b/d2warehouse/app/main.py index 68e2725..9adb262 100644 --- a/d2warehouse/app/main.py +++ b/d2warehouse/app/main.py @@ -82,7 +82,7 @@ def d2_running() -> bool: try: if proc.cmdline()[0].endswith("D2R.exe"): return True - except (IndexError, psutil.AccessDenied): + except (IndexError, psutil.AccessDenied, psutil.ZombieProcess): pass return False -- 2.49.1 From f25180c3cfce5cd3f4641db729193dc87db8858e Mon Sep 17 00:00:00 2001 From: omicron Date: Thu, 25 Sep 2025 20:54:13 +0200 Subject: [PATCH 2/4] Update to new bitarray API in the item code huffman decoding --- d2warehouse/huffman.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d2warehouse/huffman.py b/d2warehouse/huffman.py index 2f2e37d..b10fb1b 100644 --- a/d2warehouse/huffman.py +++ b/d2warehouse/huffman.py @@ -62,7 +62,7 @@ decode_tree = decodetree(code) def decode(bits: bitarray, n) -> tuple[str, int]: - text = "".join(itertools.islice(bits.iterdecode(decode_tree), n)) + text = "".join(itertools.islice(bits.decode(decode_tree), n)) length = len(encode(text)) return text, length -- 2.49.1 From 78c22bc84f92202def444870ce3ac11dc06f55c3 Mon Sep 17 00:00:00 2001 From: omicron Date: Thu, 25 Sep 2025 20:58:20 +0200 Subject: [PATCH 3/4] Add select all feature to stash tabs --- d2warehouse/app/static/helpers.js | 13 +++++++++++++ d2warehouse/app/templates/list_stash.html | 5 +++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 d2warehouse/app/static/helpers.js diff --git a/d2warehouse/app/static/helpers.js b/d2warehouse/app/static/helpers.js new file mode 100644 index 0000000..3c8b73a --- /dev/null +++ b/d2warehouse/app/static/helpers.js @@ -0,0 +1,13 @@ +function toggleSelectAll(tabIndex) { + const tab = document.querySelector(`[data-tab="${tabIndex}"]`); + const checkboxes = tab.querySelectorAll('input[type="checkbox"]'); + + if (checkboxes.length === 0) + return; + + const allSelected = Array.from(checkboxes).every(cb => cb.checked); + + checkboxes.forEach(cb => { + cb.checked = !allSelected; + }); +} diff --git a/d2warehouse/app/templates/list_stash.html b/d2warehouse/app/templates/list_stash.html index 4ce1417..6ad3b51 100644 --- a/d2warehouse/app/templates/list_stash.html +++ b/d2warehouse/app/templates/list_stash.html @@ -4,13 +4,14 @@ Shared Stash +
{% for tab in stash.tabs %} {% set tabloop = loop %} -

Tab {{tabloop.index}}

-
+

Tab {{tabloop.index}}

+
{% for item in tab.items %} {% set itemloop = loop %} {% include "item.html" %} -- 2.49.1 From 85003665c9a9caf00c3139eb73c88614cf6a2a3d Mon Sep 17 00:00:00 2001 From: omicron Date: Thu, 25 Sep 2025 21:06:17 +0200 Subject: [PATCH 4/4] Update README with instructions for running the webserver --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3240b51..1403918 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,23 @@ -Quick & dirty commit of current progress to share with others. +# Installation +Don't. + +# Development installation + +Create a virtual environment and install the development set: ``` python -m venv venv source venv/bin/activate pip install --editable .[dev] +``` + +Set your save path and run the webserver to interact with the storage system: +``` +export D2SAVE_PATH="/path/to/saves" +flask --app d2warehouse.app run +``` + +Some debug tooling: +``` d2dump /path/to/stash.d2i ``` -- 2.49.1