$musicDir = new Directory('/path/to/directory');
$scanner = new Scanner();
$scanner->addDirectory($musicDir);
$scanner->setAcceptedTypes(['flac', 'mp3']);
$scanner->scan();
$artists = $scanner->getArtists();
ksort($artists);
foreach($artists as $artist){
echo sprintf("%s\n", $artist->getName());
foreach($artist->getAlbums() as $album) {
echo sprintf("\t%s\n", $album->getName());
foreach($album->getDiscs() as $disc) {
echo sprintf("\t\t%s\n", $disc->getName());
foreach($disc->getTracks() as $track) {
echo sprintf("\t\t\t%s\n", $track->getName());
}
}
foreach($album->getTracks() as $track) {
echo sprintf("\t\t%s\n", $track->getName());
}
}
}
-
Notifications
You must be signed in to change notification settings - Fork 0
Meallia/audio-file-indexer
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
PHP tool to index audio files
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published