Skip to content

fix(ftp): upload postshow episodes into FTP_POSTSHOW_DIR#32

Open
k0te1ch wants to merge 1 commit into
mainfrom
fix/ftp-postshow-dir
Open

fix(ftp): upload postshow episodes into FTP_POSTSHOW_DIR#32
k0te1ch wants to merge 1 commit into
mainfrom
fix/ftp-postshow-dir

Conversation

@k0te1ch

@k0te1ch k0te1ch commented Jun 14, 2026

Copy link
Copy Markdown
Owner

What

Aftershow (postshow) episodes were uploading to the FTP root instead of their dedicated subfolder.

Why

The SFTP publisher read FTP_POSTSHOW_DIR from config but never applied it — sftp.open(file_name, ...) always wrote to the home directory regardless of episode type. Meanwhile the episode-number lookup (get_last_post_ID) does cwd into postshow, so the next number was computed from one folder while the file landed in another. That mismatch is what showed up as "the mp3 went to the wrong folder".

What changed

  • New _remote_path() routes postshow episodes into FTP_POSTSHOW_DIR, main episodes stay at root.
  • Accepts both aftershow (UI/state alias) and postshow (canonical) so routing doesn't depend on which alias reaches the publisher.
  • Creates the subfolder idempotently with sftp.makedirs(..., exist_ok=True) before upload.
  • 3 unit tests covering main/none/postshow routing.

Not touched

get_last_post_ID already routes to postshow correctly — the split was only on the upload side.

The SFTP publisher read FTP_POSTSHOW_DIR but never used it, so every file
landed in the home directory regardless of episode type. Aftershow episodes
were meant to go into a dedicated subfolder. Route postshow uploads into
FTP_POSTSHOW_DIR (creating it if missing) and keep main episodes at the root.
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.

1 participant