hadle streams in playlist properly

master
unK 18 years ago
parent bcd977849c
commit 022bf9781e
  1. 8
      src/helpers.cpp
  2. 6
      src/ncmpcpp.cpp
  3. 2
      src/song.cpp
  4. 1
      src/song.h

@ -361,7 +361,13 @@ string DisplaySongInColumns(const Song &s, void *s_template, const Menu<Song> *)
ss = s.GetArtist(); ss = s.GetArtist();
break; break;
case 't': case 't':
ss = s.GetTitle() != UNKNOWN_TITLE ? s.GetTitle() : s.GetShortFilename().substr(0, s.GetShortFilename().find_last_of(".")); if (s.GetTitle() != UNKNOWN_TITLE)
ss = s.GetTitle();
else
{
const string &file = s.GetShortFilename();
ss = !s.IsStream() ? file.substr(0, file.find_last_of(".")) : file;
}
break; break;
case 'b': case 'b':
ss = s.GetAlbum(); ss = s.GetAlbum();

@ -2291,7 +2291,11 @@ int main(int argc, char *argv[])
default: default:
break; break;
} }
if (GetSongTags(edited_song)) if (edited_song.IsStream())
{
ShowMessage("Cannot edit streams!");
}
else if (GetSongTags(edited_song))
{ {
wPrev = wCurrent; wPrev = wCurrent;
wCurrent = mTagEditor; wCurrent = mTagEditor;

@ -88,7 +88,7 @@ Song::~Song()
string Song::GetLength() const string Song::GetLength() const
{ {
if (!itsSong->time) if (itsSong->time <= 0)
return "-:--"; return "-:--";
return ShowTime(itsSong->time); return ShowTime(itsSong->time);
} }

@ -82,6 +82,7 @@ class Song
void GetEmptyFields(bool get) { itsGetEmptyFields = get; } void GetEmptyFields(bool get) { itsGetEmptyFields = get; }
void Clear(); void Clear();
bool Empty() const; bool Empty() const;
bool IsStream() const { return isStream; }
Song & operator=(const Song &); Song & operator=(const Song &);
bool operator==(const Song &) const; bool operator==(const Song &) const;

Loading…
Cancel
Save