CHANGE: tags are cooked. tags are a damn SNAFU. tags are out.

This commit is contained in:
TheShinyMelon 2025-03-12 00:00:52 +01:00
parent afaf940b37
commit 3584792c3a
3 changed files with 17 additions and 10 deletions

View File

@ -23,5 +23,4 @@
- [ ] get things up and running on vps - [ ] get things up and running on vps
- optional, but kinda neat: - optional, but kinda neat:
* [ ] establish password secured admin backend * [ ] establish password secured admin backend to manage content
* [ ] write id3 and flac tag extractor in php

View File

@ -2,10 +2,10 @@
function get_file_tags($input_file) { function get_file_tags($input_file) {
$input_type = mime_content_type($input_file); $input_type = mime_content_type($input_file);
// echo $input_type; //echo $input_type;
switch($input_type) { switch($input_type) {
case 'audio/mpeg': break; case 'audio/mpeg': get_mp3_tags($input_file); break;
case 'audio/flac': get_flac_tags($input_file); break; case 'audio/flac': get_flac_tags($input_file); break;
default: echo("Ey boss, that file type is NOT okay."); die(); break; default: echo("Ey boss, that file type is NOT okay."); die(); break;
} }
@ -13,4 +13,17 @@ function get_file_tags($input_file) {
function get_flac_tags($input_file) { function get_flac_tags($input_file) {
echo(fread(fopen($input_file, 'r'), 4096)); echo(fread(fopen($input_file, 'r'), 4096));
} }
function get_mp3_tags($input_file) {
$fp = fopen($input_file, "r");
fseek($fp, -64, SEEK_END);
$mdata = fgets($fp);
var_dump($mdata);
fclose($fp);
}
// https://stackoverflow.com/questions/16653100/what-are-those-32-bits-near-the-start-of-a-flac-file
// https://github.com/mdesharnais/mediatheque/

View File

@ -32,9 +32,4 @@
else { else {
get_audio($pdo); get_audio($pdo);
} }
// TODO: remove this part: TESTING ONLY!
include_once('../app/tag_extractor.php');
get_file_tags('../public/resources/aud/chronostasis.mp3');
get_file_tags('F:\MEGA Backup\musik\chronostasis\01 the enigmatic benefits of chronostasis - dan the melon lord.flac');
?> ?>