03-04-2025, 03:05 PM
(This post was last modified: 03-04-2025, 03:05 PM by Tim Curtis.)
You might not need to get into the JS.
Have a look at function enhanceMetadata() in /inc/mpd.php
Theres a code block at the bottom that handles the badges and its not considering http:// files
Maybe adding an else at the end and having that code block determine if its a UPnP file and then if yes, adding a badge if needed.
A UPnP file would have these attributes
Have a look at function enhanceMetadata() in /inc/mpd.php
Theres a code block at the bottom that handles the badges and its not considering http:// files
Code:
// Determine badging
// NOTE: This is modeled after the code in getEncodedAt()
if (!(substr($song['file'], 0, 4) == 'http' && !isset($current['duration']))) { // Not a radio station
sendMpdCmd($sock, 'lsinfo "' . $song['file'] . '"');
$songData = parseDelimFile(readMpdResp($sock), ': ');
$mpdFormatTag = explode(':', $songData['Format']);
if ($ext == 'mp3' || ($mpdFormatTag[1] == 'f' && $mpdFormatTag[2] <= 2)) {
// Lossy
$current['hidef'] = 'no';
} else if ($ext == 'dsf' || $ext == 'dff') {
// DSD
$current['hidef'] = 'yes';
} else if ($ext == 'wv') {
// WavPack DSD
$current['hidef'] = 'yes';
} else {
// PCM or Multichannel PCM
$current['hidef'] = ($mpdFormatTag[1] == 'f' || $mpdFormatTag[1] > ALBUM_BIT_DEPTH_THRESHOLD ||
$mpdFormatTag[0] > ALBUM_SAMPLE_RATE_THRESHOLD) ? 'yes' : 'no';
}
}
Maybe adding an else at the end and having that code block determine if its a UPnP file and then if yes, adding a badge if needed.
A UPnP file would have these attributes
Code:
substr($song['file'], 0, 4) == 'http' && isset($current['duration'])