1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-11 17:51:01 +00:00

refactor(googlereader): remove intermediate variable

This commit is contained in:
gudvinr 2025-08-03 23:21:40 +03:00 committed by GitHub
parent a6ce5c92dc
commit e8e3a600b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -736,14 +736,13 @@ func (h *handler) streamItemContentsHandler(w http.ResponseWriter, r *http.Reque
ID: "user/-/state/com.google/reading-list", ID: "user/-/state/com.google/reading-list",
Title: "Reading List", Title: "Reading List",
Updated: time.Now().Unix(), Updated: time.Now().Unix(),
Self: []contentHREF{ Self: []contentHREF{{
{ HREF: config.Opts.RootURL() + route.Path(h.router, "StreamItemsContents"),
HREF: config.Opts.RootURL() + route.Path(h.router, "StreamItemsContents"), }},
},
},
Author: userName, Author: userName,
Items: make([]contentItem, len(entries)),
} }
contentItems := make([]contentItem, len(entries))
for i, entry := range entries { for i, entry := range entries {
enclosures := make([]contentItemEnclosure, 0, len(entry.Enclosures)) enclosures := make([]contentItemEnclosure, 0, len(entry.Enclosures))
for _, enclosure := range entry.Enclosures { for _, enclosure := range entry.Enclosures {
@ -765,7 +764,7 @@ func (h *handler) streamItemContentsHandler(w http.ResponseWriter, r *http.Reque
entry.Content = mediaproxy.RewriteDocumentWithAbsoluteProxyURL(h.router, entry.Content) entry.Content = mediaproxy.RewriteDocumentWithAbsoluteProxyURL(h.router, entry.Content)
entry.Enclosures.ProxifyEnclosureURL(h.router, config.Opts.MediaProxyMode(), config.Opts.MediaProxyResourceTypes()) entry.Enclosures.ProxifyEnclosureURL(h.router, config.Opts.MediaProxyMode(), config.Opts.MediaProxyResourceTypes())
contentItems[i] = contentItem{ result.Items[i] = contentItem{
ID: convertEntryIDToLongFormItemID(entry.ID), ID: convertEntryIDToLongFormItemID(entry.ID),
Title: entry.Title, Title: entry.Title,
Author: entry.Author, Author: entry.Author,
@ -801,7 +800,7 @@ func (h *handler) streamItemContentsHandler(w http.ResponseWriter, r *http.Reque
Enclosure: enclosures, Enclosure: enclosures,
} }
} }
result.Items = contentItems
json.OK(w, r, result) json.OK(w, r, result)
} }