diff --git a/data/queue.go b/data/queue.go index baa39f9..98218a8 100644 --- a/data/queue.go +++ b/data/queue.go @@ -32,8 +32,12 @@ var PossibleDirs = []string{ ".newsboat", } -// QueueFilename is the name of the file for the queue. -const QueueFilename = "queue" +const ( + // QueueFilename is the name of the file for the queue. + QueueFilename = "queue" + // UnknownPodcastName is the name used for episodes from an unknown podcast. + UnknownPodcastName = "Unrecognised" +) // Possible states of download queue. const ( @@ -293,8 +297,14 @@ func (q *Queue) GetPodcasts() (podcasts []string) { defer q.mutex.RUnlock() seen := make(map[string]bool) + uncat := false + for i := range q.Items { name := DB.GetFriendlyName(q.Items[i].URL) + if name == q.Items[i].URL { + uncat = true + continue + } if !seen[name] { podcasts = append(podcasts, name) @@ -302,6 +312,9 @@ func (q *Queue) GetPodcasts() (podcasts []string) { } } + if uncat { + podcasts = append(podcasts, UnknownPodcastName) + } return } diff --git a/ui/library.go b/ui/library.go index a59a95f..63a2850 100644 --- a/ui/library.go +++ b/ui/library.go @@ -59,7 +59,12 @@ func (l *Library) renderEpisodes(x, y int) { data.Q.RevRange(func(i int, elem *data.QueueItem) bool { _, sel := l.men[0].GetSelection() - if data.DB.GetFriendlyName(elem.URL) == sel { + pc := data.DB.GetFriendlyName(elem.URL) + + // Render this item if: + // - It is a member of the current podcast + // - It is uncategorised and we are showing those + if pc == sel || (sel == data.UnknownPodcastName && pc == elem.URL) { var text string entry, ok := data.Downloads.Query(elem.Path) title := entry.Title