Skip to content

Support m3u/m3u8 playlists for mounting disk images - #22

Merged
bubio merged 1 commit into
mainfrom
feat/m3u-playlist-support
Jul 25, 2026
Merged

Support m3u/m3u8 playlists for mounting disk images#22
bubio merged 1 commit into
mainfrom
feat/m3u-playlist-support

Conversation

@bubio

Copy link
Copy Markdown
Owner

Summary

m3u / m3u8 プレイリストに対応しました。マウントは zip とまったく同じ経路(extractImagesImageSet を返す)を通るため、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 デコード、./ 除去、相対パスはプレイリストのディレクトリ基準で解決、絶対パスはそのまま、非画像・ネストしたアーカイブは除外。
    • listing order を保持(zip はソートするが、プレイリストの並び順はユーザーの意図なのでソートしない)。
    • 存在しないエントリは警告ログを出してスキップ。
  • src/ui.zig: ファイルフィルタのラベルを "Archives / Playlists (zip, m3u)" に更新。

Test plan

  • zig build test — 76/76 tests passed(プレイリストのパース・パス解決・順序保持・CP932・BOM・コメント・絶対パスを網羅)
  • macOS ネイティブビルド成功
  • 実ファイル Xak2.m3uXAK2_1.FDD / XAK2_2.FDD / XAK2_3.FDD の 3 行)で起動し、FDD0→FDD1→FDD2 に並び順どおりマウントされることを確認。エラー・警告なし

🤖 Generated with Claude Code

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
@bubio
bubio merged commit 7c4fe4f into mainJul 25, 2026
3 checks passed
@bubio
bubio deleted the feat/m3u-playlist-support branch July 25, 2026 23:56
Sign up for freeto 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

@bubio