|
a/src/ohplaylist.cxx |
|
b/src/ohplaylist.cxx |
|
... |
|
... |
139 |
out1 += (unsigned char) ((val & 0x0000ff00) >> 8);
|
139 |
out1 += (unsigned char) ((val & 0x0000ff00) >> 8);
|
140 |
out1 += (unsigned char) ((val & 0x000000ff));
|
140 |
out1 += (unsigned char) ((val & 0x000000ff));
|
141 |
}
|
141 |
}
|
142 |
sdeb += SoapHelp::i2s(val) + " ";
|
142 |
sdeb += SoapHelp::i2s(val) + " ";
|
143 |
}
|
143 |
}
|
144 |
LOGDEB("OHPlaylist: current ids: " << sdeb << endl);
|
144 |
LOGDEB("OHPlaylist::translateIdArray: current ids: " << sdeb << endl);
|
145 |
return base64_encode(out1);
|
145 |
return base64_encode(out1);
|
146 |
}
|
146 |
}
|
147 |
|
147 |
|
148 |
bool OHPlaylist::makeIdArray(string& out)
|
148 |
bool OHPlaylist::makeIdArray(string& out)
|
149 |
{
|
149 |
{
|
|
|
150 |
LOGDEB1("OHPlaylist::makeIdArray\n");
|
150 |
const MpdStatus &mpds = m_dev->getMpdStatusNoUpdate();
|
151 |
const MpdStatus &mpds = m_dev->getMpdStatusNoUpdate();
|
151 |
|
152 |
|
152 |
if (mpds.qvers == m_mpdqvers) {
|
153 |
if (mpds.qvers == m_mpdqvers) {
|
153 |
out = m_idArrayCached;
|
154 |
out = m_idArrayCached;
|
154 |
// Mpd queue did not change: no need to look at the metadata cache
|
155 |
// Mpd queue did not change: no need to look at the metadata cache
|
|
... |
|
... |
590 |
}
|
591 |
}
|
591 |
|
592 |
|
592 |
bool OHPlaylist::insertUri(int afterid, const string& uri,
|
593 |
bool OHPlaylist::insertUri(int afterid, const string& uri,
|
593 |
const string& metadata, int *newid)
|
594 |
const string& metadata, int *newid)
|
594 |
{
|
595 |
{
|
|
|
596 |
LOGDEB1("OHPlaylist::insertUri: " << uri << endl);
|
595 |
UpSong metaformpd;
|
597 |
UpSong metaformpd;
|
596 |
if (!uMetaToUpSong(metadata, &metaformpd)) {
|
598 |
if (!uMetaToUpSong(metadata, &metaformpd)) {
|
597 |
LOGERR("OHPlaylist::insert: failed to parse metadata " << " Uri ["
|
599 |
LOGERR("OHPlaylist::insert: failed to parse metadata " << " Uri ["
|
598 |
<< uri << "] Metadata [" << metadata << "]" << endl);
|
600 |
<< uri << "] Metadata [" << metadata << "]" << endl);
|
599 |
return false;
|
601 |
return false;
|
|
... |
|
... |
605 |
m_mpdqvers = -1;
|
607 |
m_mpdqvers = -1;
|
606 |
if (newid)
|
608 |
if (newid)
|
607 |
*newid = id;
|
609 |
*newid = id;
|
608 |
return true;
|
610 |
return true;
|
609 |
}
|
611 |
}
|
610 |
LOGERR("OHPlaylist::insert: mpd error" << endl);
|
612 |
LOGERR("OHPlaylist::insertUri: mpd error" << endl);
|
611 |
return false;
|
613 |
return false;
|
612 |
}
|
614 |
}
|
613 |
|
615 |
|
614 |
int OHPlaylist::deleteId(const SoapIncoming& sc, SoapOutgoing& data)
|
616 |
int OHPlaylist::deleteId(const SoapIncoming& sc, SoapOutgoing& data)
|
615 |
{
|
617 |
{
|