Support m3u/m3u8 playlists for mounting disk images - #22
Merged
Conversation
m3u/m3u8 playlists now classify as `.archive` and flow through the same extractImages/ImageSet seam as zip, so the CLI, GUI file dialog, drag-drop, and multi-disk swap modal all handle them identically. Unlike a zip, the listed images already exist on disk, so nothing is hashed, cached, or extracted: each entry is resolved against the playlist's directory (absolute paths used as-is) and mounted in listing order — the playlist's order is the user's intent, so it is not re-sorted the way the order-less zip path is. Parsing strips a leading UTF-8 BOM, ignores blank and `#`-comment lines (incl. extended-m3u directives), decodes CP932 `.m3u` entries to UTF-8, and drops non-image/nested-archive entries. Missing files are skipped with a warning. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HzDde6PsfNiqUcNLY73cUw
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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
m3u / m3u8 プレイリストに対応しました。マウントは zip とまったく同じ経路(
extractImages→ImageSetを返す)を通るため、CLI・GUI のファイルダイアログ・ドラッグ&ドロップ・複数ディスクのスワップメニューがすべて自動的に対応します。src/cli.zig:archive_extsに.m3u/.m3u8を追加(.archiveとして分類)。usage_textに Playlist 行を追記。src/archive.zig:extractImagesの冒頭でプレイリストを分岐。zip と違いキャッシュ展開は不要(実ファイルを直接参照)。parsePlaylist(純粋関数): BOM 除去、空行・#コメント(#EXTM3U/#EXTINF含む)スキップ、CR/LF 両対応、CP932(.m3u)→UTF-8 デコード、./除去、相対パスはプレイリストのディレクトリ基準で解決、絶対パスはそのまま、非画像・ネストしたアーカイブは除外。src/ui.zig: ファイルフィルタのラベルを"Archives / Playlists (zip, m3u)"に更新。Test plan
zig build test— 76/76 tests passed(プレイリストのパース・パス解決・順序保持・CP932・BOM・コメント・絶対パスを網羅)Xak2.m3u(XAK2_1.FDD/XAK2_2.FDD/XAK2_3.FDDの 3 行)で起動し、FDD0→FDD1→FDD2 に並び順どおりマウントされることを確認。エラー・警告なし🤖 Generated with Claude Code