@@ -161,25 +161,25 @@ func (c Commands) TUI() error {
161
161
return fmt .Errorf ("commands List: %w" , err )
162
162
}
163
163
164
- var errorItems []ErrorItem
165
- // if no feeds in store, fetchAllFeeds, which will return previews
166
- if len (c .config .PreviewFeeds ) > 0 {
167
- its , errorItems , err = c .fetchAllFeeds ()
168
- if err != nil {
169
- return fmt .Errorf ("[commands.go] TUI: %w" , err )
170
- }
171
- // if no items, fetchAllFeeds and GetAllFeeds
172
- } else if len (its ) == 0 {
173
- _ , errorItems , err = c .fetchAllFeeds ()
174
- if err != nil {
175
- return fmt .Errorf ("[commands.go] TUI: %w" , err )
176
- }
177
- // refetch for consistent data across calls
178
- its , err = c .GetAllFeeds ()
179
- if err != nil {
180
- return fmt .Errorf ("[commands.go] TUI: %w" , err )
181
- }
182
- }
164
+ var errorItems []ErrorItem
165
+ // if no feeds in store, fetchAllFeeds, which will return previews
166
+ if len (c .config .PreviewFeeds ) > 0 {
167
+ its , errorItems , err = c .fetchAllFeeds ()
168
+ if err != nil {
169
+ return fmt .Errorf ("[commands.go] TUI: %w" , err )
170
+ }
171
+ // if no items, fetchAllFeeds and GetAllFeeds
172
+ } else if len (its ) == 0 {
173
+ _ , errorItems , err = c .fetchAllFeeds ()
174
+ if err != nil {
175
+ return fmt .Errorf ("[commands.go] TUI: %w" , err )
176
+ }
177
+ // refetch for consistent data across calls
178
+ its , err = c .GetAllFeeds ()
179
+ if err != nil {
180
+ return fmt .Errorf ("[commands.go] TUI: %w" , err )
181
+ }
182
+ }
183
183
184
184
items := convertItems (its )
185
185
@@ -257,7 +257,7 @@ func (c Commands) fetchAllFeeds() ([]store.Item, []ErrorItem, error) {
257
257
for _ , feed := range feeds {
258
258
wg .Add (1 )
259
259
260
- go fetchFeed (ch , & wg , feed )
260
+ go fetchFeed (ch , & wg , feed , c . config . Version )
261
261
}
262
262
263
263
go func () {
@@ -336,10 +336,10 @@ func (c Commands) GetAllFeeds() ([]store.Item, error) {
336
336
return items , nil
337
337
}
338
338
339
- func fetchFeed (ch chan FetchResultError , wg * sync.WaitGroup , feed config.Feed ) {
339
+ func fetchFeed (ch chan FetchResultError , wg * sync.WaitGroup , feed config.Feed , version string ) {
340
340
defer wg .Done ()
341
341
342
- r , err := rss .Fetch (feed )
342
+ r , err := rss .Fetch (feed , version )
343
343
344
344
if err != nil {
345
345
ch <- FetchResultError {res : rss.RSS {}, err : err , url : feed .URL }
0 commit comments