Skip to content

Share one Config and helpers module - #71

Draft
chazlarson wants to merge 4 commits into
mainfrom
cursor/shared-libraries-054f
Draft

chazlarson wants to merge 4 commits into
mainfrom
cursor/shared-libraries-054f

Conversation

@chazlarson

@chazlarson chazlarson commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

The three copied Config classes and helpers.py modules are deleted. The only implementation is mediascripts/. Scripts import mediascripts.config and mediascripts.helpers and put the repo root on sys.path, so a script still runs from its own directory. The orchestrator also puts the repo root on PYTHONPATH.

  • The shared helpers keep the Plex auth-file behavior: a saved login may use baseurl or url. booler() is gone; boolean settings go through Config.get_bool, and get_int returns an int. Running the config module no longer writes a sample config.yaml.
  • get_plex() takes an optional user token and connects as that managed user. The owner path is unchanged: plexapi config, then a saved login, then an interactive login. show-all-playlists.py prints a message when a user's playlists cannot be read.
  • Root app.py is removed. It was an older image picker, and Flask is no longer a root dependency. The maintained picker is plex-image-picker/.
  • Every get_diffs compares TVDB and title. grab-all-info.py, import-IDs.py, and database.py had each stored the TMDB id twice.
  • Script bodies run from main(), including the seven that previously did their work at import: import-IDs.py, tmdb-people.py, get_TMDB_Original_Language.py, captions.py, overlay-default-posters.py, and the two Kometa auth scripts. The CURRENTLY BROKEN exit in apply-all-status.py is inside main() too.
  • Logging lives in mediascripts/logs.py. The Plex and Kometa copies are gone, and so is the unused Kometa/kometa-helpers.py.
  • Ruff now reports bare except: (E722) and redefined names (F811). Those bare handlers are except Exception.
  • .github/workflows/CI.yml installs the root and picker lockfiles with uv sync --frozen instead of the old plugin workflow.

Verification

  • ruff check passes.
  • Importing the seven previously unguarded scripts, plus show-all-playlists.py and metadata-extractor.py, does not connect to Plex, download, or prompt.
  • get_plex accepts user_token and defaults it to None.
  • orchestrator.py list still offers the runnable scripts and no longer offers the deleted helper.
  • uv lock no longer includes Flask in the root environment. The picker lockfile still does.
Open in Web Open in Cursor 

cursoragent and others added 4 commits October 21, 2026 17:17
Drop the copied loaders, keep the Plex auth-file behavior, and stop scripts from connecting to Plex or exiting just because they were imported. Remove the stale root image-picker app and point CI at the uv lockfiles.

Co-authored-by: chaz <chaz@chazlarson.com>
Scripts import mediascripts directly and add the repo root to the path, so one module remains and a script run from its own directory can still find it.

Co-authored-by: chaz <chaz@chazlarson.com>
import-IDs.py and database.py still stored the TMDB id twice, so a TVDB change was never recorded.

Co-authored-by: chaz <chaz@chazlarson.com>
get_plex takes an optional user token for managed-user connections.
Seven scripts run their bodies from main(). Logging lives in
mediascripts.logs, and the unused Kometa helper is gone.

Co-authored-by: chaz <chaz@chazlarson.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants