diff --git a/src/helpers.cpp b/src/helpers.cpp index 6351f269..9b755c59 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -361,7 +361,13 @@ string DisplaySongInColumns(const Song &s, void *s_template, const Menu *) ss = s.GetArtist(); break; 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; case 'b': ss = s.GetAlbum(); diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index 752bf7ce..34d3856f 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -2291,7 +2291,11 @@ int main(int argc, char *argv[]) default: break; } - if (GetSongTags(edited_song)) + if (edited_song.IsStream()) + { + ShowMessage("Cannot edit streams!"); + } + else if (GetSongTags(edited_song)) { wPrev = wCurrent; wCurrent = mTagEditor; diff --git a/src/song.cpp b/src/song.cpp index 76b3df88..d5f27e8b 100644 --- a/src/song.cpp +++ b/src/song.cpp @@ -88,7 +88,7 @@ Song::~Song() string Song::GetLength() const { - if (!itsSong->time) + if (itsSong->time <= 0) return "-:--"; return ShowTime(itsSong->time); } diff --git a/src/song.h b/src/song.h index 4c9dd1ce..b5879181 100644 --- a/src/song.h +++ b/src/song.h @@ -82,6 +82,7 @@ class Song void GetEmptyFields(bool get) { itsGetEmptyFields = get; } void Clear(); bool Empty() const; + bool IsStream() const { return isStream; } Song & operator=(const Song &); bool operator==(const Song &) const;