Skip to content

Commit

Permalink
Fix GetPodcasts duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
ejv2 committed Aug 9, 2024
1 parent f99a3b8 commit 72ec9f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion data/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ func (db *Database) GetPodcasts() []Podcast {
list := make([]Podcast, 0, len(db.podcasts))
seen := make(map[string]bool, len(db.podcasts))
for _, pod := range db.podcasts {
if seen, ok := seen[pod.FriendlyName]; !(ok || seen) {
if _, ok := seen[pod.FriendlyName]; !ok {
list = append(list, pod)
seen[pod.FriendlyName] = true
}
}

Expand Down

0 comments on commit 72ec9f9

Please sign in to comment.