Skip to content

Miscellaneous code improvements. - #74

Merged
galenhuntington merged 2 commits into
masterfrom
misc-fixes-1
May 17, 2026
Merged

Miscellaneous code improvements.#74
galenhuntington merged 2 commits into
masterfrom
misc-fixes-1

Conversation

@galenhuntington

@galenhuntington galenhuntington commented May 16, 2026

Copy link
Copy Markdown
Owner

This PR addresses a handful of relatively straightforward issues flagged by a Claude Code review, plus a little more:

  • An old bug where the last song is never randomly chosen is fixed. Actually, it was worse than that; the player crashes with divide by zero if there's only one song.
  • The messy genericJumpToMatch is simplified. The pure (needed for the bespoke helper function) is floated out. Eventually how state is handled should be reformed, but for now this suffices.
  • The README.md is moved to extra-doc-files where it belongs.
  • The README clarifies use with Nix.
  • The only use of non-decreasing indentation was removed above, so the extension is dropped.
  • I got rid of pSafeHead and replaced its once use with something else technically safe. mpg123 sending invalid output is a remote concern so how it's handled matters little.
  • The merge function is simplified by going through a Map.
  • A minor thing, but the .mp3 extension is better checked for. When filename encodings are in better shape, we could replace with takeExtension.
  • The spaces cache is dropped: it's both bad and pointless. Bad, because a P.take from a fixed big blank string would be far better. Pointless, because it's likely a minuscule optimization given all the other processing. Maybe this will be a Builder one day.
  • I decided that hidden files and directories are better not included or traversed at all. So, there's no longer need to special case . and ... This is technically breaking so bumping minor version.
  • A comment I added once which doesn't make sense to me now is removed.
  • An encoding issue I stumbled on and filed is fixed; closes Unicode filenames on the command line cause a crash. #72.
  • ncursesw is moved from extra-libraries to pkgconfig-depends.

@galenhuntington
galenhuntington merged commit d02ef19 into master May 17, 2026
5 checks passed
@galenhuntington
galenhuntington deleted the misc-fixes-1 branch June 1, 2026 06:10
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.

Unicode filenames on the command line cause a crash.

1 participant