08-04-2024, 07:07 PM
(This post was last modified: 08-04-2024, 07:08 PM by Tim Curtis.)
(08-04-2024, 05:36 PM)kurt1970 Wrote: Hi @Tim Curtis ,
I added some more logging in playlist.php. Now it looks like this:
Code:case 'upd_playlist':
$plName = html_entity_decode($_POST['path']['name']);
// Get metadata (may not exist so defaults will be returned)
$plMeta = getPlaylistMetadata($plName);
$updPlMeta = array('genre' => $_POST['path']['genre'], 'cover' => $plMeta['cover']);
$plItems = $_POST['path']['items'];
// Write metadata tags, contents and cover image
putPlaylistContents($plName, $updPlMeta, $plItems);
putPlaylistCover($plName);
break;
case 'add_to_playlist':
$plName = html_entity_decode($_POST['path']['playlist']);
workerLog('here0');
// Get metadata (may not exist so defaults will be returned)
$plMeta = getPlaylistMetadata($plName);
workerLog('here1');
// Replace with URL if radio station
if (count($_POST['path']['items']) == 1 && substr($_POST['path']['items'][0], -4) == '.pls') {
workerLog('here1.1');
$stName = substr($_POST['path']['items'][0], 6, -4); // Trim RADIO/ and .pls
workerLog('here1.2');
$result = sqlQuery("SELECT station FROM cfg_radio WHERE name='" . SQLite3::escapeString($stName) . "'", sqlConnect());
workerLog('here1.3');
$_POST['path']['items'][0] = $result[0]['station']; // URL
}
workerLog('here2');
// Write metadata tags, contents and cover image
putPlaylistMetadata($plName, array('#EXTGENRE:' . $plMeta['genre'], '#EXTIMG:' . $plMeta['cover']));
putPlaylistContents($plName, $plMeta, $_POST['path']['items'], FILE_APPEND);
putPlaylistCover($plName);
workerLog('here3');
break;
Test 1: A radio station is playing, and I try to add a radio station to a PL. Test failed. Following info in the log:
20240804 193502 here0
20240804 193502 here1
Test 2: No radio station is playing, and I try to add a radio station to a PL. Test passed. Following info in the log:
20240804 193533 here0
20240804 193533 here1
20240804 193533 here1.1
20240804 193533 here1.2
20240804 193533 here1.3
20240804 193533 here2
20240804 193536 here3
Ok, good.
Right after the workerLog('here1'); line place the the new workerLog() line shown below and then post the results from the moode log for a failure case. It should be a breakdown of the contents of the $_POST array. This might provide a clue.
Code:
workerLog(print_r($_POST, true));