How habu-kagumba/music-library works
This is a command-line music catalog: users can list songs, artists, and genres, play a selected song, or browse songs by artist or genre. The controller imports the configured MP3 directory, then dispatches interactive commands against in-memory Song, Artist, and Genre collections. Song filename parsing and relationship wiring form the key domain layer; the shared Findable concern supports name-based lookup. Importer and CLI implementation excerpts are incomplete, so the graph only shows their documented and directly evidenced relationships; “play” is presented as output, not audio playback.
Main entry points: music_importer_controller.rb Command controller · song.rb Song catalog · artist.rb Artist catalog · genre.rb Genre catalog
Components 9
CLI interface
- CLI launcher
bin/musiclibrary - Command controller
lib/music_importer_controller.rb
Catalog domain
- Song catalog
lib/song.rb - Artist catalog
lib/artist.rb - Genre catalog
lib/genre.rb - Name lookup
lib/concerns/findable.rb
Library import
- MP3 importer
lib/music_importer.rb - MP3 directory
db/mp3s
Other components
- Library user
Connections 15
- Library user → CLI launcher: runs
README.md - CLI launcher → Command controller: starts
- Library user → Command controller: enters commands
lib/music_importer_controller.rb - Command controller → MP3 importer: imports
lib/music_importer_controller.rb - MP3 importer → MP3 directory: reads files
- Command controller → Song catalog: lists and plays
lib/music_importer_controller.rb - Command controller → Artist catalog: finds artist
lib/music_importer_controller.rb - Command controller → Genre catalog: finds genre
lib/music_importer_controller.rb - Song catalog → Artist catalog: assigns artist
lib/song.rb - Song catalog → Genre catalog: assigns genre
lib/song.rb - Artist catalog → Song catalog: collects songs
lib/artist.rb - Genre catalog → Song catalog: collects songs
lib/genre.rb - Song catalog → Name lookup: uses lookup
lib/song.rb - Artist catalog → Name lookup: uses lookup
lib/artist.rb - Genre catalog → Name lookup: uses lookup
lib/genre.rb