Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

playerengine status #11

Open
andig opened this issue Aug 18, 2015 · 3 comments
Open

playerengine status #11

andig opened this issue Aug 18, 2015 · 3 comments

Comments

@andig
Copy link
Owner

andig commented Aug 18, 2015

In playerengine, mpd status is read and enhanced:

if (isset($track[0]['Title'])) {
    $status['fileext'] = parseFileStr($track[0]['file'], '.');

    $status['currentartist'] = $track[0]['Artist'];
    $status['currentsong'] = $track[0]['Title'];
    $status['currentalbum'] = $track[0]['Album'];
}
else {
    $path = parseFileStr($track[0]['file'], '/');
    $status['fileext'] = parseFileStr($track[0]['file'], '.');

    $status['currentartist'] = "";
    $status['currentsong'] = $song;
    $status['currentalbum'] = "path: ".$path;
}

In the second case $song is assigned which doesn't exist. What are the two cases and how should song be set in the second file?

@moodeaudio
Copy link

Don’t know the story behind the unassigned $song var. It was same in the original sources. There may have been some code in Playerengine that got accidentally deleted and no one noticed.

We should discuss Playerengine in depth because it looks like it should work by sending status and current song data back to UI when MPD idle timeout occurs, but in practice the UI never seemed to reflect the current song data thus u will see a JS function named mpdCurrentSong().

I remember walking the MPD commands by hand, matching them up to the code and then I got to function _parseFileListResponse() and became a bit confused.

Tim

On Aug 18, 2015, at 6:52 AM, andig [email protected] wrote:

In playerengine, mpd status is read and enhanced:

if (isset($track[0]['Title'])) {
$status['fileext'] = parseFileStr($track[0]['file'], '.');

$status['currentartist'] = $track[0]['Artist'];
$status['currentsong'] = $track[0]['Title'];
$status['currentalbum'] = $track[0]['Album'];

}
else {
$path = parseFileStr($track[0]['file'], '/');
$status['fileext'] = parseFileStr($track[0]['file'], '.');

$status['currentartist'] = "";
$status['currentsong'] = $song;
$status['currentalbum'] = "path: ".$path;

}
In the second case $song is assigned which doesn't exist. What are the two cases and how should song be set in the second file?


Reply to this email directly or view it on GitHub #11.

@andig
Copy link
Owner Author

andig commented Aug 18, 2015

Doing so right now. Could you get me samples of playerengine output for radio, mp3, playlist and upnp? At least playlist and upnp, dont have those. In general, pe seems fine.

Lets get rid of currentsong ;)

@moodeaudio
Copy link

My thought exactly, pe should work and no need for mpdCurrentSong().

Logic for how to differentiate between song files, UPnP song files and radio stations is in mpdCurrentSong(), getPlaylist(), and player_wrk.php. It’s all basically the same logic, just factored a bit depending on whether to display under Album Art or as a Playlist Item or as a Playback history item.

Maybe just move this logic to PE?

I’ll put together some sample MPD status, playlistinfo and currentsong command output in a bit. I can’t do UPnP because that was all done by Ralf Braun. I coded and he tested and sent back MPD output from his UPnP based setup.

Tim

On Aug 18, 2015, at 2:41 PM, andig [email protected] wrote:

Doing so right now. Could you get me samples of playerengine output for radio, mp3, playlist and upnp? At least playlist and upnp, dont have those. In general, pe seems fine.

Lets get rid of currentsong ;)


Reply to this email directly or view it on GitHub #11 (comment).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants