repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
6d5b4e3
parent
32a8a51
author
Eric Bower
date
2024-04-01 14:37:28 +0000 UTC
refactor(feeds): change digest var name
1 files changed,  +9, -9
M feeds/cron.go
+9, -9
 1@@ -75,24 +75,24 @@ func itemToTemplate(item *gofeed.Item) *FeedItemTmpl {
 2 	}
 3 }
 4 
 5-func digestOptionToTime(date time.Time, interval string) time.Time {
 6+func digestOptionToTime(lastDigest time.Time, interval string) time.Time {
 7 	day := 24 * time.Hour
 8 	if interval == "10min" {
 9-		return date.Add(10 * time.Minute)
10+		return  lastDigest.Add(10 * time.Minute)
11 	} else if interval == "1hour" {
12-		return date.Add(1 * time.Hour)
13+		return  lastDigest.Add(1 * time.Hour)
14 	} else if interval == "6hour" {
15-		return date.Add(6 * time.Hour)
16+		return  lastDigest.Add(6 * time.Hour)
17 	} else if interval == "12hour" {
18-		return date.Add(12 * time.Hour)
19+		return  lastDigest.Add(12 * time.Hour)
20 	} else if interval == "1day" || interval == "" {
21-		return date.Add(1 * day)
22+		return  lastDigest.Add(1 * day)
23 	} else if interval == "7day" {
24-		return date.Add(7 * day)
25+		return  lastDigest.Add(7 * day)
26 	} else if interval == "30day" {
27-		return date.Add(30 * day)
28+		return  lastDigest.Add(30 * day)
29 	} else {
30-		return date
31+		return lastDigest 
32 	}
33 }
34