-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_art.php
executable file
·22 lines (21 loc) · 912 Bytes
/
get_art.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
require('config.php');
//echo "select * from music_albumart where song_id=" . $_GET['song_id'] . " order by albumart_id desc limit 1";
$query = mysqli_query($conn, "select * from music_albumart where song_id=" . $_GET['song_id'] . " order by albumart_id desc limit 1");
$songs = array();
$row= mysqli_fetch_array($query);
//echo mysqli_error($conn);
//print_r($row);exit;
if(count($row)>0 & !empty($row['filename'])){
$ext = @pathinfo('/mnt/storage/CoverArt/' . $row['filename'], PATHINFO_EXTENSION);
@header('content-type: image/' . $ext);
$str= @file_get_contents('/mnt/storage/CoverArt/AlbumArt/' . $row['filename']);
}else{
header('content-type: image/jpg');
$str = file_get_contents('/mnt/storage/MusicArt/mark.jpg');
}
if(empty($str)){
header('content-type: image/jpg');
$str = file_get_contents('/mnt/storage/MusicArt/mark.jpg');
}
echo $str;