i have my music directories set up as /artist/album with a jpg of the album art within each album directory. is there an easy way to modify the admin_updateDb.php to link the album art during recursion?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Buried deep within the updateDb code is the following snippit:
else {
print "<p>New song found: <b>$filename</b><br>";
$song = new Song(NULL, $filename);
$song->read_data_from_file(TRUE);
$song->add_to_db(1);
echo "</p>";
}
After the $song->read_data_from_file(TRUE) call you should be guaranteed
to have a valid album_id which you can get with $song->album_id. You
can use this and the "album.class.php" code (which you might need to
include) to modify the appropriate album table row.
...although inefficient should probably work for your needs. You'll
need to figure out a way to provide the path to the album art which you
would have to somehow make available via HTTP. One way would be to add
symbolic links for all of your art to some kind of common image
directory, alternatively you could open up access to your audio files
via HTTP and block the downloading of audio files (if this is a concern)
through .htaccess files.
Also, the above hack would only work for new songs. You would have to
devise a new script to detect if album art was updated or handle it
manually by updating the SQL tables or writing a script to modify the
album table.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i have my music directories set up as /artist/album with a jpg of the album art within each album directory. is there an easy way to modify the admin_updateDb.php to link the album art during recursion?
Buried deep within the updateDb code is the following snippit:
else {
print "<p>New song found: <b>$filename</b><br>";
$song = new Song(NULL, $filename);
$song->read_data_from_file(TRUE);
$song->add_to_db(1);
echo "</p>";
}
After the $song->read_data_from_file(TRUE) call you should be guaranteed
to have a valid album_id which you can get with $song->album_id. You
can use this and the "album.class.php" code (which you might need to
include) to modify the appropriate album table row.
$album = new Album($song->album_id);
$album->load();
$album->small_album_cover = "http://server/path/to/small/art.jpg";
$album->large_album_cover = "http://server/path/to/large/art.jpg";
$album->save();
...although inefficient should probably work for your needs. You'll
need to figure out a way to provide the path to the album art which you
would have to somehow make available via HTTP. One way would be to add
symbolic links for all of your art to some kind of common image
directory, alternatively you could open up access to your audio files
via HTTP and block the downloading of audio files (if this is a concern)
through .htaccess files.
Also, the above hack would only work for new songs. You would have to
devise a new script to detect if album art was updated or handle it
manually by updating the SQL tables or writing a script to modify the
album table.