fixed #2049
This commit is contained in:
parent
0059d67a54
commit
115bce9de2
|
@ -1302,11 +1302,13 @@ WebStorageClient :: getPlaylist(Ptr<SessionId>::Ref sessionId,
|
|||
playlist->configure(*root);
|
||||
|
||||
} catch (std::invalid_argument &e) {
|
||||
throw XmlRpcInvalidDataException(
|
||||
"semantic error in playlist metafile");
|
||||
std::string eMsg = "semantic error in playlist metafile: ";
|
||||
eMsg += e.what();
|
||||
throw XmlRpcInvalidDataException(eMsg);
|
||||
} catch (xmlpp::exception &e) {
|
||||
throw XmlRpcInvalidDataException(
|
||||
"error parsing playlist metafile");
|
||||
std::string eMsg = "error parsing playlist metafile: ";
|
||||
eMsg += e.what();
|
||||
throw XmlRpcInvalidDataException(eMsg);
|
||||
}
|
||||
playlist->setToken(token);
|
||||
|
||||
|
@ -1344,11 +1346,13 @@ WebStorageClient :: editPlaylist(Ptr<SessionId>::Ref sessionId,
|
|||
playlist->configure(*root);
|
||||
|
||||
} catch (std::invalid_argument &e) {
|
||||
throw XmlRpcMethodResponseException(
|
||||
"semantic error in playlist metafile");
|
||||
std::string eMsg = "semantic error in playlist metafile: ";
|
||||
eMsg += e.what();
|
||||
throw XmlRpcInvalidDataException(eMsg);
|
||||
} catch (xmlpp::exception &e) {
|
||||
throw XmlRpcMethodResponseException(
|
||||
"error parsing playlist metafile");
|
||||
std::string eMsg = "error parsing playlist metafile: ";
|
||||
eMsg += e.what();
|
||||
throw XmlRpcInvalidDataException(eMsg);
|
||||
}
|
||||
|
||||
playlist->setEditToken(editToken);
|
||||
|
@ -1541,11 +1545,13 @@ WebStorageClient :: acquirePlaylist(Ptr<const UniqueId>::Ref id,
|
|||
playlist->configure(*root);
|
||||
|
||||
} catch (std::invalid_argument &e) {
|
||||
throw XmlRpcInvalidDataException(
|
||||
"semantic error in playlist metafile");
|
||||
std::string eMsg = "semantic error in playlist metafile: ";
|
||||
eMsg += e.what();
|
||||
throw XmlRpcInvalidDataException(eMsg);
|
||||
} catch (xmlpp::exception &e) {
|
||||
throw XmlRpcInvalidDataException(
|
||||
"error parsing playlist metafile");
|
||||
std::string eMsg = "error parsing playlist metafile: ";
|
||||
eMsg += e.what();
|
||||
throw XmlRpcInvalidDataException(eMsg);
|
||||
}
|
||||
|
||||
// read the content array corresponding to the playlist
|
||||
|
@ -1885,11 +1891,11 @@ WebStorageClient :: getAudioClip(Ptr<SessionId>::Ref sessionId,
|
|||
audioClip->configure(*root);
|
||||
|
||||
} catch (std::invalid_argument &e) {
|
||||
std::string eMsg = "semantic error in audio clip metafile:\n";
|
||||
std::string eMsg = "semantic error in audio clip metafile: ";
|
||||
eMsg += e.what();
|
||||
throw XmlRpcInvalidDataException(eMsg);
|
||||
} catch (xmlpp::exception &e) {
|
||||
std::string eMsg = "error parsing audio clip metafile";
|
||||
std::string eMsg = "error parsing audio clip metafile: ";
|
||||
eMsg += e.what();
|
||||
throw XmlRpcInvalidDataException(eMsg);
|
||||
}
|
||||
|
|
|
@ -736,8 +736,12 @@ GLiveSupport :: getAudioClip(Ptr<const UniqueId>::Ref id)
|
|||
{
|
||||
Ptr<AudioClip>::Ref clip;
|
||||
|
||||
clip = (*openedAudioClips)[id->getId()];
|
||||
if (!clip.get()) {
|
||||
AudioClipMap::iterator it = openedAudioClips->find(id->getId());
|
||||
if (it != openedAudioClips->end()) {
|
||||
clip = it->second;
|
||||
}
|
||||
|
||||
if (!clip || !clip->getToken()) {
|
||||
clip = storage->getAudioClip(sessionId, id);
|
||||
(*openedAudioClips)[id->getId()] = clip;
|
||||
}
|
||||
|
@ -757,8 +761,10 @@ GLiveSupport :: acquireAudioClip(Ptr<const UniqueId>::Ref id)
|
|||
{
|
||||
Ptr<AudioClip>::Ref clip;
|
||||
|
||||
clip = (*openedAudioClips)[id->getId()];
|
||||
if (!clip.get() || !clip->getToken().get()) {
|
||||
AudioClipMap::iterator it = openedAudioClips->find(id->getId());
|
||||
if (it != openedAudioClips->end()) {
|
||||
clip = it->second;
|
||||
} else {
|
||||
clip = storage->acquireAudioClip(sessionId, id);
|
||||
(*openedAudioClips)[id->getId()] = clip;
|
||||
}
|
||||
|
@ -778,8 +784,10 @@ GLiveSupport :: getPlaylist(Ptr<const UniqueId>::Ref id)
|
|||
{
|
||||
Ptr<Playlist>::Ref playlist;
|
||||
|
||||
playlist = (*openedPlaylists)[id->getId()];
|
||||
if (!playlist.get()) {
|
||||
PlaylistMap::iterator it = openedPlaylists->find(id->getId());
|
||||
if (it != openedPlaylists->end()) {
|
||||
playlist = it->second;
|
||||
} else {
|
||||
playlist = storage->getPlaylist(sessionId, id);
|
||||
(*openedPlaylists)[id->getId()] = playlist;
|
||||
}
|
||||
|
@ -799,8 +807,12 @@ GLiveSupport :: acquirePlaylist(Ptr<const UniqueId>::Ref id)
|
|||
{
|
||||
Ptr<Playlist>::Ref playlist;
|
||||
|
||||
playlist = (*openedPlaylists)[id->getId()];
|
||||
if (!playlist.get() || !playlist->getUri().get()) {
|
||||
PlaylistMap::iterator it = openedPlaylists->find(id->getId());
|
||||
if (it != openedPlaylists->end()) {
|
||||
playlist = it->second;
|
||||
}
|
||||
|
||||
if (!playlist || !playlist->getUri()) {
|
||||
playlist = storage->acquirePlaylist(sessionId, id);
|
||||
(*openedPlaylists)[id->getId()] = playlist;
|
||||
}
|
||||
|
@ -827,7 +839,7 @@ GLiveSupport :: getPlayable(Ptr<const UniqueId>::Ref id)
|
|||
|
||||
} else {
|
||||
throw XmlRpcInvalidArgumentException(
|
||||
"invalid ID in GLiveSupport::acquirePlayable");
|
||||
"invalid ID in GLiveSupport::getPlayable");
|
||||
}
|
||||
|
||||
return playable;
|
||||
|
@ -873,7 +885,7 @@ GLiveSupport :: uncachePlaylist(Ptr<const UniqueId>::Ref id)
|
|||
|
||||
if ((it = openedPlaylists->find(id->getId())) != end) {
|
||||
playlist = (*openedPlaylists)[id->getId()];
|
||||
if (playlist->getUri().get()) {
|
||||
if (playlist->getUri()) {
|
||||
storage->releasePlaylist(playlist);
|
||||
}
|
||||
|
||||
|
@ -893,7 +905,7 @@ GLiveSupport :: releaseOpenedAudioClips(void) throw (XmlRpcException)
|
|||
AudioClipMap::iterator end = openedAudioClips->end();
|
||||
|
||||
while (it != end) {
|
||||
Ptr<AudioClip>::Ref clip = (*it).second;
|
||||
Ptr<AudioClip>::Ref clip = it->second;
|
||||
|
||||
if (clip->getToken().get()) {
|
||||
storage->releaseAudioClip(clip);
|
||||
|
@ -917,9 +929,9 @@ GLiveSupport :: releaseOpenedPlaylists(void) throw (XmlRpcException)
|
|||
PlaylistMap::iterator end = openedPlaylists->end();
|
||||
|
||||
while (it != end) {
|
||||
Ptr<Playlist>::Ref playlist = (*it).second;
|
||||
Ptr<Playlist>::Ref playlist = it->second;
|
||||
|
||||
if (playlist->getUri().get()) {
|
||||
if (playlist->getUri()) {
|
||||
storage->releasePlaylist(playlist);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue