fix switching to artist info screen

if one switched from artist info screen while artist info was being
downloaded, {s,}he wouldn't be able to enter the screen again.
master
Andrzej Rybczak 16 years ago
parent fa027bbcc9
commit f90176ffee
  1. 2
      src/lastfm.cpp
  2. 1
      src/lastfm.h
  3. 2
      src/ncmpcpp.cpp

@ -214,7 +214,7 @@ void Lastfm::Refetch()
bool Lastfm::SetArtistInfoArgs(const std::string &artist, const std::string &lang) bool Lastfm::SetArtistInfoArgs(const std::string &artist, const std::string &lang)
{ {
if (isDownloadInProgress) if (isDownloading())
return false; return false;
itsService.reset(new ArtistInfo); itsService.reset(new ArtistInfo);

@ -53,6 +53,7 @@ class Lastfm : public Screen<Scrollpad>
void Refetch(); void Refetch();
bool isDownloading() { return isDownloadInProgress && !isReadyToTake; }
bool SetArtistInfoArgs(const std::string &artist, const std::string &lang = ""); bool SetArtistInfoArgs(const std::string &artist, const std::string &lang = "");
protected: protected:

@ -2142,7 +2142,7 @@ int main(int argc, char *argv[])
# ifdef HAVE_CURL_CURL_H # ifdef HAVE_CURL_CURL_H
else if (Keypressed(input, Key.ArtistInfo)) else if (Keypressed(input, Key.ArtistInfo))
{ {
if (myScreen == myLastfm) if (myScreen == myLastfm || myLastfm->isDownloading())
{ {
myLastfm->SwitchTo(); myLastfm->SwitchTo();
continue; continue;

Loading…
Cancel
Save