From 6296a2bb5631fbb511ebf9d6c979fb79b4847c6d Mon Sep 17 00:00:00 2001 From: Maksym Pavlenko Date: Tue, 28 May 2019 12:53:32 -0700 Subject: [PATCH] Do full resync for playlist items --- pkg/feeds/feeds.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkg/feeds/feeds.go b/pkg/feeds/feeds.go index c05be5a..478ac05 100644 --- a/pkg/feeds/feeds.go +++ b/pkg/feeds/feeds.go @@ -152,7 +152,7 @@ func (s *Service) BuildFeed(hashID string) ([]byte, error) { } // Submit to SQS for background update - s.sender.Add(&queue.Item{ + item := &queue.Item{ ID: feed.HashID, URL: feed.ItemURL, Start: 1, @@ -160,7 +160,16 @@ func (s *Service) BuildFeed(hashID string) ([]byte, error) { LastID: feed.LastID, Format: string(feed.Format), Quality: string(feed.Quality), - }) + } + + if feed.LinkType == api.LinkTypePlaylist { + // Playlist is a special case. Last ID tracks a latest episode on a channel, + // it appears as the first one in the list. New playlist items are added to + // the end of list, so sync with last seen ID doesn't work here as expected. + item.LastID = "" + } + + s.sender.Add(item) // Output the feed