Fix CLI crash when Plex is disabled in config - #41
Open
bin101 wants to merge 3 commits into
Open
Conversation
…n in console dialog Loading a config where plex.enabled is explicitly false still forced Plex username/password mode, causing a login attempt with empty credentials (plexapi BadRequest). The resulting error dialog then crashed with "asyncio.run() cannot be called from a running event loop" because the console's message dialog called the synchronous Application.run() from inside the already-running event loop.
bin101
marked this pull request as draft
July 13, 2026 10:53
The setter was defined as set_language instead of language, so the @language.setter decorator bound the resulting property to the wrong name and the language attribute stayed read-only, raising AttributeError: property 'language' of 'OrganizerStore' object has no setter.
…arker
extra_fields.get("new_show", False) was checked with isinstance(x, int),
but bool is a subclass of int in Python, so the default False (and the
in-progress True sentinel) were both mistaken for a stored file_action
value. This tried to delete a "new_show" key that was never set,
raising KeyError and aborting before save_config() could run - so no
config was written after a run without Plex enabled.
bin101
marked this pull request as ready for review
July 31, 2026 13:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
plex.enabledis explicitlyfalsestill forced Plex username/password mode, causing a login attempt with empty credentials and aplexapi.exceptions.BadRequest.RuntimeError: asyncio.run() cannot be called from a running event loop, because the console's message dialog called the synchronousApplication.run()from inside the already-running event loop.AttributeError: property 'language' of 'OrganizerStore' object has no setter— the setter function was namedset_languageinstead oflanguage, so the@language.setterdecorator bound to the wrong name and the property stayed read-only.KeyError: 'new_show'and never wrote the config, becauseisinstance(extra_fields.get("new_show", False), int)isTruefor the defaultFalsevalue (boolis a subclass ofintin Python), causing an attempt to delete a key that was never set.Fixes #23
Changes
src/organizer.py: respect the actual boolean value ofplex.enabledinstead of only checking its presence.src/console.py: make_message_dialogasync and userun_async(), matching the existing_input_dialogand GUI implementations.src/store.py: rename thelanguageproperty setter function fromset_languagetolanguageso it actually attaches to the property.src/console.py: excludeboolin thenew_showint check instart_process()'sfinallyblock so the sentinel/default values don't trigger a bogus key deletion.Test plan
py_compilepasses for all changed filesplex.enabled: false(no top-levelmode) in console mode and confirm it starts in .nfo/Jellyfin mode without attempting a Plex loginplex.enabled: true/ validmodestill go through the Plex login flow unchangedAttributeErroris raisedKeyError