`,
+ }
+ Rewriter("https://example.org/article", testEntry, `remove_tables`)
- if expected != output {
- t.Errorf(`Not expected output: got "%s" instead of "%s"`, output, expected)
+ if !reflect.DeepEqual(testEntry, controlEntry) {
+ t.Errorf(`Not expected output: got "%+v" instead of "%+v"`, testEntry, controlEntry)
+ }
+}
+
+func TestRemoveClickbait(t *testing.T) {
+ controlEntry := &model.Entry{
+ Title: `This Is Amazing`,
+ Content: `Some description`,
+ }
+ testEntry := &model.Entry{
+ Title: `THIS IS AMAZING`,
+ Content: `Some description`,
+ }
+ Rewriter("https://example.org/article", testEntry, `remove_clickbait`)
+
+ if !reflect.DeepEqual(testEntry, controlEntry) {
+ t.Errorf(`Not expected output: got "%+v" instead of "%+v"`, testEntry, controlEntry)
}
}
diff --git a/reader/rewrite/rules.go b/reader/rewrite/rules.go
index ec6963b8..c2262644 100644
--- a/reader/rewrite/rules.go
+++ b/reader/rewrite/rules.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package rewrite // import "miniflux.app/reader/rewrite"
@@ -17,7 +16,7 @@ var predefinedRules = map[string]string{
"exocomics.com": "add_image_title",
"framatube.org": "nl2br,convert_text_link",
"happletea.com": "add_image_title",
- "ilpost.it": `remove(".art_tag, #audioPlayerArticle, .author-container, .caption, .ilpostShare, .lastRecents, #mc_embed_signup, .outbrain_inread, p:has(.leggi-anche)")`,
+ "ilpost.it": `remove(".art_tag, #audioPlayerArticle, .author-container, .caption, .ilpostShare, .lastRecents, #mc_embed_signup, .outbrain_inread, p:has(.leggi-anche), .youtube-overlay")`,
"imogenquest.net": "add_image_title",
"lukesurl.com": "add_image_title",
"medium.com": "fix_medium_images",
diff --git a/reader/rss/doc.go b/reader/rss/doc.go
deleted file mode 100644
index f5a92fca..00000000
--- a/reader/rss/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package rss provides a RSS feed parser.
-*/
-package rss // import "miniflux.app/reader/rss"
diff --git a/reader/rss/dublincore.go b/reader/rss/dublincore.go
index c461ece8..320d5c61 100644
--- a/reader/rss/dublincore.go
+++ b/reader/rss/dublincore.go
@@ -1,6 +1,5 @@
-// Copyright 2019 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package rss // import "miniflux.app/reader/rss"
diff --git a/reader/rss/feedburner.go b/reader/rss/feedburner.go
index baa4e19e..87c9f875 100644
--- a/reader/rss/feedburner.go
+++ b/reader/rss/feedburner.go
@@ -1,6 +1,5 @@
-// Copyright 2019 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package rss // import "miniflux.app/reader/rss"
diff --git a/reader/rss/parser.go b/reader/rss/parser.go
index 6c9af4ff..13f8e4b4 100644
--- a/reader/rss/parser.go
+++ b/reader/rss/parser.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package rss // import "miniflux.app/reader/rss"
diff --git a/reader/rss/parser_test.go b/reader/rss/parser_test.go
index d0662c60..e3d106da 100644
--- a/reader/rss/parser_test.go
+++ b/reader/rss/parser_test.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package rss // import "miniflux.app/reader/rss"
@@ -18,6 +17,11 @@ func TestParseRss2Sample(t *testing.T) {
Liftoff News
http://liftoff.msfc.nasa.gov/
Liftoff to Space Exploration.
+
+ http://liftoff.msfc.nasa.gov/HomePageXtra/MeatBall.gif
+ NASA
+ http://liftoff.msfc.nasa.gov/
+ en-usTue, 10 Jun 2003 04:00:00 GMTTue, 10 Jun 2003 09:41:01 GMT
@@ -71,6 +75,10 @@ func TestParseRss2Sample(t *testing.T) {
t.Errorf("Incorrect site URL, got: %s", feed.SiteURL)
}
+ if feed.IconURL != "http://liftoff.msfc.nasa.gov/HomePageXtra/MeatBall.gif" {
+ t.Errorf("Incorrect image URL, got: %s", feed.IconURL)
+ }
+
if len(feed.Entries) != 4 {
t.Errorf("Incorrect number of entries, got: %d", len(feed.Entries))
}
diff --git a/reader/rss/podcast.go b/reader/rss/podcast.go
index 61501ee9..a7d9ab53 100644
--- a/reader/rss/podcast.go
+++ b/reader/rss/podcast.go
@@ -1,6 +1,5 @@
-// Copyright 2019 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package rss // import "miniflux.app/reader/rss"
diff --git a/reader/rss/rss.go b/reader/rss/rss.go
index 2969f6bc..48c436af 100644
--- a/reader/rss/rss.go
+++ b/reader/rss/rss.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package rss // import "miniflux.app/reader/rss"
@@ -27,6 +26,7 @@ type rssFeed struct {
Version string `xml:"version,attr"`
Title string `xml:"channel>title"`
Links []rssLink `xml:"channel>link"`
+ ImageURL string `xml:"channel>image>url"`
Language string `xml:"channel>language"`
Description string `xml:"channel>description"`
PubDate string `xml:"channel>pubDate"`
@@ -58,6 +58,8 @@ func (r *rssFeed) Transform(baseURL string) *model.Feed {
feed.Title = feed.SiteURL
}
+ feed.IconURL = strings.TrimSpace(r.ImageURL)
+
for _, item := range r.Items {
entry := item.Transform()
if entry.Author == "" {
diff --git a/reader/sanitizer/doc.go b/reader/sanitizer/doc.go
deleted file mode 100644
index 8e7a4d13..00000000
--- a/reader/sanitizer/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package sanitizer implements a HTML sanitizer that removes unsafe elements.
-*/
-package sanitizer // import "miniflux.app/reader/sanitizer"
diff --git a/reader/sanitizer/sanitizer.go b/reader/sanitizer/sanitizer.go
index 29b5d3fa..9d1154b9 100644
--- a/reader/sanitizer/sanitizer.go
+++ b/reader/sanitizer/sanitizer.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package sanitizer // import "miniflux.app/reader/sanitizer"
diff --git a/reader/sanitizer/sanitizer_test.go b/reader/sanitizer/sanitizer_test.go
index 65961875..4b2a5cb7 100644
--- a/reader/sanitizer/sanitizer_test.go
+++ b/reader/sanitizer/sanitizer_test.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package sanitizer // import "miniflux.app/reader/sanitizer"
diff --git a/reader/sanitizer/srcset.go b/reader/sanitizer/srcset.go
index 758d8d5c..0db17b43 100644
--- a/reader/sanitizer/srcset.go
+++ b/reader/sanitizer/srcset.go
@@ -1,6 +1,5 @@
-// Copyright 2022 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package sanitizer
diff --git a/reader/sanitizer/srcset_test.go b/reader/sanitizer/srcset_test.go
index 4f19f9c3..e1501373 100644
--- a/reader/sanitizer/srcset_test.go
+++ b/reader/sanitizer/srcset_test.go
@@ -1,6 +1,5 @@
-// Copyright 2022 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package sanitizer
diff --git a/reader/sanitizer/strip_tags.go b/reader/sanitizer/strip_tags.go
index 8dc944fc..263ef91f 100644
--- a/reader/sanitizer/strip_tags.go
+++ b/reader/sanitizer/strip_tags.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package sanitizer // import "miniflux.app/reader/sanitizer"
diff --git a/reader/sanitizer/strip_tags_test.go b/reader/sanitizer/strip_tags_test.go
index 18a0ce82..33a07016 100644
--- a/reader/sanitizer/strip_tags_test.go
+++ b/reader/sanitizer/strip_tags_test.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package sanitizer // import "miniflux.app/reader/sanitizer"
diff --git a/reader/sanitizer/truncate.go b/reader/sanitizer/truncate.go
index 04acc1d6..bac2b453 100644
--- a/reader/sanitizer/truncate.go
+++ b/reader/sanitizer/truncate.go
@@ -1,6 +1,5 @@
-// Copyright 2022 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package sanitizer
diff --git a/reader/sanitizer/truncate_test.go b/reader/sanitizer/truncate_test.go
index 2c7e87b6..bb50f039 100644
--- a/reader/sanitizer/truncate_test.go
+++ b/reader/sanitizer/truncate_test.go
@@ -1,6 +1,5 @@
-// Copyright 2022 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package sanitizer
diff --git a/reader/scraper/doc.go b/reader/scraper/doc.go
deleted file mode 100644
index 5419c257..00000000
--- a/reader/scraper/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package scraper implements a web page crawler.
-*/
-package scraper // import "miniflux.app/reader/scraper"
diff --git a/reader/scraper/rules.go b/reader/scraper/rules.go
index 5ee66b49..8e0fef74 100644
--- a/reader/scraper/rules.go
+++ b/reader/scraper/rules.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package scraper // import "miniflux.app/reader/scraper"
diff --git a/reader/scraper/scraper.go b/reader/scraper/scraper.go
index 81ebd8c8..d2fef40a 100644
--- a/reader/scraper/scraper.go
+++ b/reader/scraper/scraper.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package scraper // import "miniflux.app/reader/scraper"
diff --git a/reader/scraper/scraper_test.go b/reader/scraper/scraper_test.go
index 53bf37ee..9d586c78 100644
--- a/reader/scraper/scraper_test.go
+++ b/reader/scraper/scraper_test.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package scraper // import "miniflux.app/reader/scraper"
diff --git a/reader/subscription/doc.go b/reader/subscription/doc.go
deleted file mode 100644
index b8b4d1a0..00000000
--- a/reader/subscription/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package subscription implements the logic to find subscriptions on a website.
-*/
-package subscription // import "miniflux.app/reader/subscription"
diff --git a/reader/subscription/finder.go b/reader/subscription/finder.go
index 8d941e8d..df3d275a 100644
--- a/reader/subscription/finder.go
+++ b/reader/subscription/finder.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package subscription // import "miniflux.app/reader/subscription"
diff --git a/reader/subscription/finder_test.go b/reader/subscription/finder_test.go
index 6ea0606e..9124bdeb 100644
--- a/reader/subscription/finder_test.go
+++ b/reader/subscription/finder_test.go
@@ -1,6 +1,5 @@
-// Copyright 2020 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package subscription
diff --git a/reader/subscription/subscription.go b/reader/subscription/subscription.go
index 604dce56..2a7ff55b 100644
--- a/reader/subscription/subscription.go
+++ b/reader/subscription/subscription.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package subscription // import "miniflux.app/reader/subscription"
diff --git a/reader/xml/decoder.go b/reader/xml/decoder.go
index 7e5cd755..edf58f47 100644
--- a/reader/xml/decoder.go
+++ b/reader/xml/decoder.go
@@ -1,6 +1,5 @@
-// Copyright 2019 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package xml // import "miniflux.app/reader/xml"
diff --git a/reader/xml/decoder_test.go b/reader/xml/decoder_test.go
index 1208ef86..a350955a 100644
--- a/reader/xml/decoder_test.go
+++ b/reader/xml/decoder_test.go
@@ -1,6 +1,5 @@
-// Copyright 2019 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package xml // import "miniflux.app/reader/xml"
diff --git a/service/httpd/doc.go b/service/httpd/doc.go
deleted file mode 100644
index 05f6e7c8..00000000
--- a/service/httpd/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package httpd implements the HTTP service.
-*/
-package httpd // import "miniflux.app/service/httpd"
diff --git a/service/scheduler/doc.go b/service/scheduler/doc.go
deleted file mode 100644
index acb1425d..00000000
--- a/service/scheduler/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package scheduler implements the scheduler service.
-*/
-package scheduler // import "miniflux.app/service/scheduler"
diff --git a/service/scheduler/scheduler.go b/service/scheduler/scheduler.go
deleted file mode 100644
index c8dd1322..00000000
--- a/service/scheduler/scheduler.go
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-package scheduler // import "miniflux.app/service/scheduler"
-
-import (
- "time"
-
- "miniflux.app/config"
- "miniflux.app/logger"
- "miniflux.app/metric"
- "miniflux.app/model"
- "miniflux.app/storage"
- "miniflux.app/worker"
-)
-
-// Serve starts the internal scheduler.
-func Serve(store *storage.Storage, pool *worker.Pool) {
- logger.Info(`Starting scheduler...`)
-
- go feedScheduler(
- store,
- pool,
- config.Opts.PollingFrequency(),
- config.Opts.BatchSize(),
- )
-
- go cleanupScheduler(
- store,
- config.Opts.CleanupFrequencyHours(),
- config.Opts.CleanupArchiveReadDays(),
- config.Opts.CleanupArchiveUnreadDays(),
- config.Opts.CleanupArchiveBatchSize(),
- config.Opts.CleanupRemoveSessionsDays(),
- )
-}
-
-func feedScheduler(store *storage.Storage, pool *worker.Pool, frequency, batchSize int) {
- for range time.Tick(time.Duration(frequency) * time.Minute) {
- jobs, err := store.NewBatch(batchSize)
- if err != nil {
- logger.Error("[Scheduler:Feed] %v", err)
- } else {
- logger.Debug("[Scheduler:Feed] Pushing %d jobs", len(jobs))
- pool.Push(jobs)
- }
- }
-}
-
-func cleanupScheduler(store *storage.Storage, frequency, archiveReadDays, archiveUnreadDays, archiveBatchSize, sessionsDays int) {
- for range time.Tick(time.Duration(frequency) * time.Hour) {
- nbSessions := store.CleanOldSessions(sessionsDays)
- nbUserSessions := store.CleanOldUserSessions(sessionsDays)
- logger.Info("[Scheduler:Cleanup] Cleaned %d sessions and %d user sessions", nbSessions, nbUserSessions)
-
- startTime := time.Now()
- if rowsAffected, err := store.ArchiveEntries(model.EntryStatusRead, archiveReadDays, archiveBatchSize); err != nil {
- logger.Error("[Scheduler:ArchiveReadEntries] %v", err)
- } else {
- logger.Info("[Scheduler:ArchiveReadEntries] %d entries changed", rowsAffected)
-
- if config.Opts.HasMetricsCollector() {
- metric.ArchiveEntriesDuration.WithLabelValues(model.EntryStatusRead).Observe(time.Since(startTime).Seconds())
- }
- }
-
- startTime = time.Now()
- if rowsAffected, err := store.ArchiveEntries(model.EntryStatusUnread, archiveUnreadDays, archiveBatchSize); err != nil {
- logger.Error("[Scheduler:ArchiveUnreadEntries] %v", err)
- } else {
- logger.Info("[Scheduler:ArchiveUnreadEntries] %d entries changed", rowsAffected)
-
- if config.Opts.HasMetricsCollector() {
- metric.ArchiveEntriesDuration.WithLabelValues(model.EntryStatusUnread).Observe(time.Since(startTime).Seconds())
- }
- }
- }
-}
diff --git a/storage/api_key.go b/storage/api_key.go
index 00db91df..ea25e484 100644
--- a/storage/api_key.go
+++ b/storage/api_key.go
@@ -1,6 +1,5 @@
-// Copyright 2020 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package storage // import "miniflux.app/storage"
diff --git a/storage/category.go b/storage/category.go
index 14e19a53..c5e5f74d 100644
--- a/storage/category.go
+++ b/storage/category.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package storage // import "miniflux.app/storage"
diff --git a/storage/certificate_cache.go b/storage/certificate_cache.go
index 9025df13..0e0c26e0 100644
--- a/storage/certificate_cache.go
+++ b/storage/certificate_cache.go
@@ -1,6 +1,5 @@
-// Copyright 2020 Dave Marquard. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package storage // import "miniflux.app/storage"
diff --git a/storage/doc.go b/storage/doc.go
deleted file mode 100644
index f5af3109..00000000
--- a/storage/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package storage implements a set of functions to interact with the database.
-*/
-package storage // import "miniflux.app/storage"
diff --git a/storage/enclosure.go b/storage/enclosure.go
index aa9f64ef..3573609b 100644
--- a/storage/enclosure.go
+++ b/storage/enclosure.go
@@ -1,12 +1,12 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package storage // import "miniflux.app/storage"
import (
"database/sql"
"fmt"
+ "strings"
"miniflux.app/model"
)
@@ -20,7 +20,8 @@ func (s *Storage) GetEnclosures(entryID int64) (model.EnclosureList, error) {
entry_id,
url,
size,
- mime_type
+ mime_type,
+ media_progression
FROM
enclosures
WHERE
@@ -44,6 +45,7 @@ func (s *Storage) GetEnclosures(entryID int64) (model.EnclosureList, error) {
&enclosure.URL,
&enclosure.Size,
&enclosure.MimeType,
+ &enclosure.MediaProgression,
)
if err != nil {
@@ -56,46 +58,135 @@ func (s *Storage) GetEnclosures(entryID int64) (model.EnclosureList, error) {
return enclosures, nil
}
+func (s *Storage) GetEnclosure(enclosureID int64) (*model.Enclosure, error) {
+ query := `
+ SELECT
+ id,
+ user_id,
+ entry_id,
+ url,
+ size,
+ mime_type,
+ media_progression
+ FROM
+ enclosures
+ WHERE
+ id = $1
+ ORDER BY id ASC
+ `
+
+ row := s.db.QueryRow(query, enclosureID)
+
+ var enclosure model.Enclosure
+ err := row.Scan(
+ &enclosure.ID,
+ &enclosure.UserID,
+ &enclosure.EntryID,
+ &enclosure.URL,
+ &enclosure.Size,
+ &enclosure.MimeType,
+ &enclosure.MediaProgression,
+ )
+
+ if err != nil {
+ return nil, fmt.Errorf(`store: unable to fetch enclosure row: %v`, err)
+ }
+
+ return &enclosure, nil
+}
+
func (s *Storage) createEnclosure(tx *sql.Tx, enclosure *model.Enclosure) error {
- if enclosure.URL == "" {
+ enclosureURL := strings.TrimSpace(enclosure.URL)
+ if enclosureURL == "" {
return nil
}
query := `
INSERT INTO enclosures
- (url, size, mime_type, entry_id, user_id)
+ (url, size, mime_type, entry_id, user_id, media_progression)
VALUES
- ($1, $2, $3, $4, $5)
- RETURNING
- id
+ ($1, $2, $3, $4, $5, $6)
+ ON CONFLICT (user_id, entry_id, md5(url)) DO NOTHING
`
- err := tx.QueryRow(
+ _, err := tx.Exec(
query,
- enclosure.URL,
+ enclosureURL,
enclosure.Size,
enclosure.MimeType,
enclosure.EntryID,
enclosure.UserID,
- ).Scan(&enclosure.ID)
+ enclosure.MediaProgression,
+ )
if err != nil {
- return fmt.Errorf(`store: unable to create enclosure %q: %v`, enclosure.URL, err)
+ return fmt.Errorf(`store: unable to create enclosure: %v`, err)
}
return nil
}
func (s *Storage) updateEnclosures(tx *sql.Tx, userID, entryID int64, enclosures model.EnclosureList) error {
- // We delete all attachments in the transaction to keep only the ones visible in the feeds.
- if _, err := tx.Exec(`DELETE FROM enclosures WHERE user_id=$1 AND entry_id=$2`, userID, entryID); err != nil {
- return err
+ if len(enclosures) == 0 {
+ return nil
}
+ sqlValues := []any{userID, entryID}
+ sqlPlaceholders := []string{}
+
for _, enclosure := range enclosures {
+ sqlPlaceholders = append(sqlPlaceholders, fmt.Sprintf(`$%d`, len(sqlValues)+1))
+ sqlValues = append(sqlValues, strings.TrimSpace(enclosure.URL))
+
if err := s.createEnclosure(tx, enclosure); err != nil {
return err
}
}
+ query := `
+ DELETE FROM enclosures
+ WHERE
+ user_id=$1 AND
+ entry_id=$2 AND
+ url NOT IN (%s)
+ `
+
+ query = fmt.Sprintf(query, strings.Join(sqlPlaceholders, `,`))
+
+ _, err := tx.Exec(query, sqlValues...)
+ if err != nil {
+ return fmt.Errorf(`store: unable to delete old enclosures: %v`, err)
+ }
+
+ return nil
+}
+
+func (s *Storage) UpdateEnclosure(enclosure *model.Enclosure) error {
+ query := `
+ UPDATE
+ enclosures
+ SET
+ url=$1,
+ size=$2,
+ mime_type=$3,
+ entry_id=$4,
+ user_id=$5,
+ media_progression=$6
+ WHERE
+ id=$7
+ `
+ _, err := s.db.Exec(query,
+ enclosure.URL,
+ enclosure.Size,
+ enclosure.MimeType,
+ enclosure.EntryID,
+ enclosure.UserID,
+ enclosure.MediaProgression,
+ enclosure.ID,
+ )
+
+ if err != nil {
+ return fmt.Errorf(`store: unable to update enclosure #%d : %v`, enclosure.ID, err)
+ }
+
return nil
}
diff --git a/storage/entry.go b/storage/entry.go
index f99d9ccc..5dbb9c04 100644
--- a/storage/entry.go
+++ b/storage/entry.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package storage // import "miniflux.app/storage"
@@ -220,15 +219,17 @@ func (s *Storage) updateEntry(tx *sql.Tx, entry *model.Entry) error {
}
// entryExists checks if an entry already exists based on its hash when refreshing a feed.
-func (s *Storage) entryExists(tx *sql.Tx, entry *model.Entry) bool {
+func (s *Storage) entryExists(tx *sql.Tx, entry *model.Entry) (bool, error) {
var result bool
- tx.QueryRow(
- `SELECT true FROM entries WHERE user_id=$1 AND feed_id=$2 AND hash=$3`,
- entry.UserID,
- entry.FeedID,
- entry.Hash,
- ).Scan(&result)
- return result
+
+ // Note: This query uses entries_feed_id_hash_key index (filtering on user_id is not necessary).
+ err := tx.QueryRow(`SELECT true FROM entries WHERE feed_id=$1 AND hash=$2`, entry.FeedID, entry.Hash).Scan(&result)
+
+ if err != nil && err != sql.ErrNoRows {
+ return result, fmt.Errorf(`store: unable to check if entry exists: %v`, err)
+ }
+
+ return result, nil
}
// GetReadTime fetches the read time of an entry based on its hash, and the feed id and user id from the feed.
@@ -275,7 +276,15 @@ func (s *Storage) RefreshFeedEntries(userID, feedID int64, entries model.Entries
return fmt.Errorf(`store: unable to start transaction: %v`, err)
}
- if s.entryExists(tx, entry) {
+ entryExists, err := s.entryExists(tx, entry)
+ if err != nil {
+ if rollbackErr := tx.Rollback(); rollbackErr != nil {
+ return fmt.Errorf(`store: unable to rollback transaction: %v (rolled back due to: %v)`, rollbackErr, err)
+ }
+ return err
+ }
+
+ if entryExists {
if updateExistingEntries {
err = s.updateEntry(tx, entry)
}
@@ -284,7 +293,9 @@ func (s *Storage) RefreshFeedEntries(userID, feedID int64, entries model.Entries
}
if err != nil {
- tx.Rollback()
+ if rollbackErr := tx.Rollback(); rollbackErr != nil {
+ return fmt.Errorf(`store: unable to rollback transaction: %v (rolled back due to: %v)`, rollbackErr, err)
+ }
return err
}
@@ -449,6 +460,33 @@ func (s *Storage) MarkAllAsRead(userID int64) error {
return nil
}
+// MarkGloballyVisibleFeedsAsRead updates all user entries to the read status.
+func (s *Storage) MarkGloballyVisibleFeedsAsRead(userID int64) error {
+ query := `
+ UPDATE
+ entries
+ SET
+ status=$1,
+ changed_at=now()
+ FROM
+ feeds
+ WHERE
+ entries.feed_id = feeds.id
+ AND entries.user_id=$2
+ AND entries.status=$3
+ AND feeds.hide_globally=$4
+ `
+ result, err := s.db.Exec(query, model.EntryStatusRead, userID, model.EntryStatusUnread, false)
+ if err != nil {
+ return fmt.Errorf(`store: unable to mark globally visible feeds as read: %v`, err)
+ }
+
+ count, _ := result.RowsAffected()
+ logger.Debug("[Storage:MarkGloballyVisibleFeedsAsRead] %d items marked as read", count)
+
+ return nil
+}
+
// MarkFeedAsRead updates all feed entries to the read status.
func (s *Storage) MarkFeedAsRead(userID, feedID int64, before time.Time) error {
query := `
diff --git a/storage/entry_pagination_builder.go b/storage/entry_pagination_builder.go
index 5b7d5ec1..13987c84 100644
--- a/storage/entry_pagination_builder.go
+++ b/storage/entry_pagination_builder.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package storage // import "miniflux.app/storage"
diff --git a/storage/entry_query_builder.go b/storage/entry_query_builder.go
index dae7bc1f..ce50e342 100644
--- a/storage/entry_query_builder.go
+++ b/storage/entry_query_builder.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package storage // import "miniflux.app/storage"
@@ -18,13 +17,12 @@ import (
// EntryQueryBuilder builds a SQL query to fetch entries.
type EntryQueryBuilder struct {
- store *Storage
- args []interface{}
- conditions []string
- order string
- direction string
- limit int
- offset int
+ store *Storage
+ args []interface{}
+ conditions []string
+ sortExpressions []string
+ limit int
+ offset int
}
// WithSearchQuery adds full-text search query to the condition.
@@ -35,8 +33,10 @@ func (e *EntryQueryBuilder) WithSearchQuery(query string) *EntryQueryBuilder {
e.args = append(e.args, query)
// 0.0000001 = 0.1 / (seconds_in_a_day)
- e.WithOrder(fmt.Sprintf("ts_rank(document_vectors, plainto_tsquery($%d)) - extract (epoch from now() - published_at)::float * 0.0000001", nArgs))
- e.WithDirection("DESC")
+ e.WithSorting(
+ fmt.Sprintf("ts_rank(document_vectors, plainto_tsquery($%d)) - extract (epoch from now() - published_at)::float * 0.0000001", nArgs),
+ "DESC",
+ )
}
return e
}
@@ -168,15 +168,9 @@ func (e *EntryQueryBuilder) WithShareCodeNotEmpty() *EntryQueryBuilder {
return e
}
-// WithOrder set the sorting order.
-func (e *EntryQueryBuilder) WithOrder(order string) *EntryQueryBuilder {
- e.order = order
- return e
-}
-
-// WithDirection set the sorting direction.
-func (e *EntryQueryBuilder) WithDirection(direction string) *EntryQueryBuilder {
- e.direction = direction
+// WithSorting add a sort expression.
+func (e *EntryQueryBuilder) WithSorting(column, direction string) *EntryQueryBuilder {
+ e.sortExpressions = append(e.sortExpressions, fmt.Sprintf("%s %s", column, direction))
return e
}
@@ -272,6 +266,7 @@ func (e *EntryQueryBuilder) GetEntries() (model.Entries, error) {
f.crawler,
f.user_agent,
f.cookie,
+ f.no_media_player,
fi.icon_id,
u.timezone
FROM
@@ -336,6 +331,7 @@ func (e *EntryQueryBuilder) GetEntries() (model.Entries, error) {
&entry.Feed.Crawler,
&entry.Feed.UserAgent,
&entry.Feed.Cookie,
+ &entry.Feed.NoMediaPlayer,
&iconID,
&tz,
)
@@ -401,12 +397,8 @@ func (e *EntryQueryBuilder) buildCondition() string {
func (e *EntryQueryBuilder) buildSorting() string {
var parts []string
- if e.order != "" {
- parts = append(parts, fmt.Sprintf(`ORDER BY %s`, e.order))
- }
-
- if e.direction != "" {
- parts = append(parts, e.direction)
+ if len(e.sortExpressions) > 0 {
+ parts = append(parts, fmt.Sprintf(`ORDER BY %s`, strings.Join(e.sortExpressions, ", ")))
}
if e.limit > 0 {
diff --git a/storage/feed.go b/storage/feed.go
index 03d0ba1c..df36bdec 100644
--- a/storage/feed.go
+++ b/storage/feed.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package storage // import "miniflux.app/storage"
@@ -135,8 +134,7 @@ func (s *Storage) CountAllFeedsWithErrors() int {
// Feeds returns all feeds that belongs to the given user.
func (s *Storage) Feeds(userID int64) (model.Feeds, error) {
builder := NewFeedQueryBuilder(s, userID)
- builder.WithOrder(model.DefaultFeedSorting)
- builder.WithDirection(model.DefaultFeedSortingDirection)
+ builder.WithSorting(model.DefaultFeedSorting, model.DefaultFeedSortingDirection)
return builder.GetFeeds()
}
@@ -153,8 +151,7 @@ func getFeedsSorted(builder *FeedQueryBuilder) (model.Feeds, error) {
func (s *Storage) FeedsWithCounters(userID int64) (model.Feeds, error) {
builder := NewFeedQueryBuilder(s, userID)
builder.WithCounters()
- builder.WithOrder(model.DefaultFeedSorting)
- builder.WithDirection(model.DefaultFeedSortingDirection)
+ builder.WithSorting(model.DefaultFeedSorting, model.DefaultFeedSortingDirection)
return getFeedsSorted(builder)
}
@@ -171,8 +168,7 @@ func (s *Storage) FeedsByCategoryWithCounters(userID, categoryID int64) (model.F
builder := NewFeedQueryBuilder(s, userID)
builder.WithCategoryID(categoryID)
builder.WithCounters()
- builder.WithOrder(model.DefaultFeedSorting)
- builder.WithDirection(model.DefaultFeedSortingDirection)
+ builder.WithSorting(model.DefaultFeedSorting, model.DefaultFeedSortingDirection)
return getFeedsSorted(builder)
}
@@ -243,10 +239,11 @@ func (s *Storage) CreateFeed(feed *model.Feed) error {
allow_self_signed_certificates,
fetch_via_proxy,
hide_globally,
- url_rewrite_rules
+ url_rewrite_rules,
+ no_media_player
)
VALUES
- ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22)
+ ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23)
RETURNING
id
`
@@ -274,6 +271,7 @@ func (s *Storage) CreateFeed(feed *model.Feed) error {
feed.FetchViaProxy,
feed.HideGlobally,
feed.UrlRewriteRules,
+ feed.NoMediaPlayer,
).Scan(&feed.ID)
if err != nil {
return fmt.Errorf(`store: unable to create feed %q: %v`, feed.FeedURL, err)
@@ -288,9 +286,19 @@ func (s *Storage) CreateFeed(feed *model.Feed) error {
return fmt.Errorf(`store: unable to start transaction: %v`, err)
}
- if !s.entryExists(tx, feed.Entries[i]) {
+ entryExists, err := s.entryExists(tx, feed.Entries[i])
+ if err != nil {
+ if rollbackErr := tx.Rollback(); rollbackErr != nil {
+ return fmt.Errorf(`store: unable to rollback transaction: %v (rolled back due to: %v)`, rollbackErr, err)
+ }
+ return err
+ }
+
+ if !entryExists {
if err := s.createEntry(tx, feed.Entries[i]); err != nil {
- tx.Rollback()
+ if rollbackErr := tx.Rollback(); rollbackErr != nil {
+ return fmt.Errorf(`store: unable to rollback transaction: %v (rolled back due to: %v)`, rollbackErr, err)
+ }
return err
}
}
@@ -333,9 +341,10 @@ func (s *Storage) UpdateFeed(feed *model.Feed) (err error) {
allow_self_signed_certificates=$22,
fetch_via_proxy=$23,
hide_globally=$24,
- url_rewrite_rules=$25
+ url_rewrite_rules=$25,
+ no_media_player=$26
WHERE
- id=$26 AND user_id=$27
+ id=$27 AND user_id=$28
`
_, err = s.db.Exec(query,
feed.FeedURL,
@@ -363,6 +372,7 @@ func (s *Storage) UpdateFeed(feed *model.Feed) (err error) {
feed.FetchViaProxy,
feed.HideGlobally,
feed.UrlRewriteRules,
+ feed.NoMediaPlayer,
feed.ID,
feed.UserID,
)
diff --git a/storage/feed_query_builder.go b/storage/feed_query_builder.go
index 4f3194db..88862b55 100644
--- a/storage/feed_query_builder.go
+++ b/storage/feed_query_builder.go
@@ -1,6 +1,5 @@
-// Copyright 2021 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package storage // import "miniflux.app/storage"
@@ -18,8 +17,7 @@ type FeedQueryBuilder struct {
store *Storage
args []interface{}
conditions []string
- order string
- direction string
+ sortExpressions []string
limit int
offset int
withCounters bool
@@ -66,15 +64,9 @@ func (f *FeedQueryBuilder) WithCounters() *FeedQueryBuilder {
return f
}
-// WithOrder set the sorting order.
-func (f *FeedQueryBuilder) WithOrder(order string) *FeedQueryBuilder {
- f.order = order
- return f
-}
-
-// WithDirection set the sorting direction.
-func (f *FeedQueryBuilder) WithDirection(direction string) *FeedQueryBuilder {
- f.direction = direction
+// WithSorting add a sort expression.
+func (f *FeedQueryBuilder) WithSorting(column, direction string) *FeedQueryBuilder {
+ f.sortExpressions = append(f.sortExpressions, fmt.Sprintf("%s %s", column, direction))
return f
}
@@ -101,12 +93,8 @@ func (f *FeedQueryBuilder) buildCounterCondition() string {
func (f *FeedQueryBuilder) buildSorting() string {
var parts []string
- if f.order != "" {
- parts = append(parts, fmt.Sprintf(`ORDER BY %s`, f.order))
- }
-
- if f.direction != "" {
- parts = append(parts, f.direction)
+ if len(f.sortExpressions) > 0 {
+ parts = append(parts, fmt.Sprintf(`ORDER BY %s`, strings.Join(f.sortExpressions, ", ")))
}
if len(parts) > 0 {
@@ -167,6 +155,7 @@ func (f *FeedQueryBuilder) GetFeeds() (model.Feeds, error) {
f.allow_self_signed_certificates,
f.fetch_via_proxy,
f.disabled,
+ f.no_media_player,
f.hide_globally,
f.category_id,
c.title as category_title,
@@ -230,6 +219,7 @@ func (f *FeedQueryBuilder) GetFeeds() (model.Feeds, error) {
&feed.AllowSelfSignedCertificates,
&feed.FetchViaProxy,
&feed.Disabled,
+ &feed.NoMediaPlayer,
&feed.HideGlobally,
&feed.Category.ID,
&feed.Category.Title,
diff --git a/storage/icon.go b/storage/icon.go
index 57e6a6fb..ffae3ac2 100644
--- a/storage/icon.go
+++ b/storage/icon.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package storage // import "miniflux.app/storage"
diff --git a/storage/integration.go b/storage/integration.go
index 71ed83c0..98dd271c 100644
--- a/storage/integration.go
+++ b/storage/integration.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package storage // import "miniflux.app/storage"
@@ -147,6 +146,8 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) {
linkding_enabled,
linkding_url,
linkding_api_key,
+ linkding_tags,
+ linkding_mark_as_unread,
matrix_bot_enabled,
matrix_bot_user,
matrix_bot_password,
@@ -196,6 +197,8 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) {
&integration.LinkdingEnabled,
&integration.LinkdingURL,
&integration.LinkdingAPIKey,
+ &integration.LinkdingTags,
+ &integration.LinkdingMarkAsUnread,
&integration.MatrixBotEnabled,
&integration.MatrixBotUser,
&integration.MatrixBotPassword,
@@ -260,13 +263,15 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error {
linkding_enabled=$34,
linkding_url=$35,
linkding_api_key=$36,
- matrix_bot_enabled=$37,
- matrix_bot_user=$38,
- matrix_bot_password=$39,
- matrix_bot_url=$40,
- matrix_bot_chat_id=$41
+ linkding_tags=$37,
+ linkding_mark_as_unread=$38,
+ matrix_bot_enabled=$39,
+ matrix_bot_user=$40,
+ matrix_bot_password=$41,
+ matrix_bot_url=$42,
+ matrix_bot_chat_id=$43
WHERE
- user_id=$42
+ user_id=$44
`
_, err = s.db.Exec(
query,
@@ -306,6 +311,8 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error {
integration.LinkdingEnabled,
integration.LinkdingURL,
integration.LinkdingAPIKey,
+ integration.LinkdingTags,
+ integration.LinkdingMarkAsUnread,
integration.MatrixBotEnabled,
integration.MatrixBotUser,
integration.MatrixBotPassword,
@@ -354,13 +361,15 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error {
linkding_enabled=$34,
linkding_url=$35,
linkding_api_key=$36,
- matrix_bot_enabled=$37,
- matrix_bot_user=$38,
- matrix_bot_password=$39,
- matrix_bot_url=$40,
- matrix_bot_chat_id=$41
+ linkding_tags=$37,
+ linkding_mark_as_unread=$38,
+ matrix_bot_enabled=$39,
+ matrix_bot_user=$40,
+ matrix_bot_password=$41,
+ matrix_bot_url=$42,
+ matrix_bot_chat_id=$43
WHERE
- user_id=$42
+ user_id=$44
`
_, err = s.db.Exec(
query,
@@ -400,6 +409,8 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error {
integration.LinkdingEnabled,
integration.LinkdingURL,
integration.LinkdingAPIKey,
+ integration.LinkdingTags,
+ integration.LinkdingMarkAsUnread,
integration.MatrixBotEnabled,
integration.MatrixBotUser,
integration.MatrixBotPassword,
diff --git a/storage/job.go b/storage/job.go
index 57e289ed..e983b55c 100644
--- a/storage/job.go
+++ b/storage/job.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package storage // import "miniflux.app/storage"
diff --git a/storage/session.go b/storage/session.go
index f57b68e8..71de8291 100644
--- a/storage/session.go
+++ b/storage/session.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package storage // import "miniflux.app/storage"
diff --git a/storage/storage.go b/storage/storage.go
index ca3d2360..5b582b1f 100644
--- a/storage/storage.go
+++ b/storage/storage.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package storage // import "miniflux.app/storage"
diff --git a/storage/timezone.go b/storage/timezone.go
index d21ac262..14545093 100644
--- a/storage/timezone.go
+++ b/storage/timezone.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package storage // import "miniflux.app/storage"
diff --git a/storage/user.go b/storage/user.go
index 4b0737f2..5e20cee4 100644
--- a/storage/user.go
+++ b/storage/user.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package storage // import "miniflux.app/storage"
@@ -87,10 +86,11 @@ func (s *Storage) CreateUser(userCreationRequest *model.UserCreationRequest) (*m
openid_connect_id,
display_mode,
entry_order,
- default_reading_speed,
- cjk_reading_speed,
- default_home_page,
- categories_sorting_order
+ default_reading_speed,
+ cjk_reading_speed,
+ default_home_page,
+ categories_sorting_order,
+ mark_read_on_view
`
tx, err := s.db.Begin()
@@ -128,6 +128,7 @@ func (s *Storage) CreateUser(userCreationRequest *model.UserCreationRequest) (*m
&user.CJKReadingSpeed,
&user.DefaultHomePage,
&user.CategoriesSortingOrder,
+ &user.MarkReadOnView,
)
if err != nil {
tx.Rollback()
@@ -183,9 +184,10 @@ func (s *Storage) UpdateUser(user *model.User) error {
default_reading_speed=$18,
cjk_reading_speed=$19,
default_home_page=$20,
- categories_sorting_order=$21
+ categories_sorting_order=$21,
+ mark_read_on_view=$22
WHERE
- id=$22
+ id=$23
`
_, err = s.db.Exec(
@@ -211,6 +213,7 @@ func (s *Storage) UpdateUser(user *model.User) error {
user.CJKReadingSpeed,
user.DefaultHomePage,
user.CategoriesSortingOrder,
+ user.MarkReadOnView,
user.ID,
)
if err != nil {
@@ -238,9 +241,10 @@ func (s *Storage) UpdateUser(user *model.User) error {
default_reading_speed=$17,
cjk_reading_speed=$18,
default_home_page=$19,
- categories_sorting_order=$20
+ categories_sorting_order=$20,
+ mark_read_on_view=$21
WHERE
- id=$21
+ id=$22
`
_, err := s.db.Exec(
@@ -265,6 +269,7 @@ func (s *Storage) UpdateUser(user *model.User) error {
user.CJKReadingSpeed,
user.DefaultHomePage,
user.CategoriesSortingOrder,
+ user.MarkReadOnView,
user.ID,
)
@@ -311,7 +316,8 @@ func (s *Storage) UserByID(userID int64) (*model.User, error) {
default_reading_speed,
cjk_reading_speed,
default_home_page,
- categories_sorting_order
+ categories_sorting_order,
+ mark_read_on_view
FROM
users
WHERE
@@ -345,7 +351,8 @@ func (s *Storage) UserByUsername(username string) (*model.User, error) {
default_reading_speed,
cjk_reading_speed,
default_home_page,
- categories_sorting_order
+ categories_sorting_order,
+ mark_read_on_view
FROM
users
WHERE
@@ -379,7 +386,8 @@ func (s *Storage) UserByField(field, value string) (*model.User, error) {
default_reading_speed,
cjk_reading_speed,
default_home_page,
- categories_sorting_order
+ categories_sorting_order,
+ mark_read_on_view
FROM
users
WHERE
@@ -420,7 +428,8 @@ func (s *Storage) UserByAPIKey(token string) (*model.User, error) {
u.default_reading_speed,
u.cjk_reading_speed,
u.default_home_page,
- u.categories_sorting_order
+ u.categories_sorting_order,
+ u.mark_read_on_view
FROM
users u
LEFT JOIN
@@ -456,6 +465,7 @@ func (s *Storage) fetchUser(query string, args ...interface{}) (*model.User, err
&user.CJKReadingSpeed,
&user.DefaultHomePage,
&user.CategoriesSortingOrder,
+ &user.MarkReadOnView,
)
if err == sql.ErrNoRows {
@@ -552,7 +562,8 @@ func (s *Storage) Users() (model.Users, error) {
default_reading_speed,
cjk_reading_speed,
default_home_page,
- categories_sorting_order
+ categories_sorting_order,
+ mark_read_on_view
FROM
users
ORDER BY username ASC
@@ -589,6 +600,7 @@ func (s *Storage) Users() (model.Users, error) {
&user.CJKReadingSpeed,
&user.DefaultHomePage,
&user.CategoriesSortingOrder,
+ &user.MarkReadOnView,
)
if err != nil {
diff --git a/storage/user_session.go b/storage/user_session.go
index e891bbcc..edc3c2a4 100644
--- a/storage/user_session.go
+++ b/storage/user_session.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package storage // import "miniflux.app/storage"
diff --git a/systemd/systemd.go b/systemd/systemd.go
index d4415a0c..5f7a149e 100644
--- a/systemd/systemd.go
+++ b/systemd/systemd.go
@@ -1,6 +1,5 @@
-// Copyright 2021 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package systemd // import "miniflux.app/systemd"
diff --git a/template/engine.go b/template/engine.go
index 3436de7a..2d3071c4 100644
--- a/template/engine.go
+++ b/template/engine.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package template // import "miniflux.app/template"
diff --git a/template/functions.go b/template/functions.go
index fd2b44a7..0a3a5657 100644
--- a/template/functions.go
+++ b/template/functions.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package template // import "miniflux.app/template"
@@ -108,6 +107,7 @@ func (f *funcMap) Map() template.FuncMap {
"nonce": func() string {
return crypto.GenerateRandomStringHex(16)
},
+ "deRef": func(i *int) int { return *i },
// These functions are overrode at runtime after the parsing.
"elapsed": func(timezone string, t time.Time) string {
diff --git a/template/functions_test.go b/template/functions_test.go
index 3df35bfb..5b6e4341 100644
--- a/template/functions_test.go
+++ b/template/functions_test.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package template // import "miniflux.app/template"
diff --git a/template/templates/common/feed_list.html b/template/templates/common/feed_list.html
index 906385fe..b41bcfbe 100644
--- a/template/templates/common/feed_list.html
+++ b/template/templates/common/feed_list.html
@@ -20,7 +20,7 @@
diff --git a/template/templates/views/search_entries.html b/template/templates/views/search_entries.html
index 4c73ac5b..04db64a9 100644
--- a/template/templates/views/search_entries.html
+++ b/template/templates/views/search_entries.html
@@ -19,7 +19,7 @@
{{ if ne .Feed.Icon.IconID 0 }}
{{ end }}
- {{ .Title }}
+ {{ .Title }}{{ .Feed.Category.Title }}
diff --git a/template/templates/views/settings.html b/template/templates/views/settings.html
index a7d7e26b..ce3d0d7a 100644
--- a/template/templates/views/settings.html
+++ b/template/templates/views/settings.html
@@ -99,6 +99,8 @@
+
+
diff --git a/template/templates/views/shared_entries.html b/template/templates/views/shared_entries.html
index a2e1962c..eb5bd93a 100644
--- a/template/templates/views/shared_entries.html
+++ b/template/templates/views/shared_entries.html
@@ -32,7 +32,7 @@
{{ if ne .Feed.Icon.IconID 0 }}
{{ end }}
- {{ .Title }}
+ {{ .Title }}
{{ if .ShareCode }}
{{ end }}
- {{ .Title }}
+ {{ .Title }}{{ .Feed.Category.Title }}
diff --git a/tests/category_test.go b/tests/category_test.go
index e99cb98d..5ef4a0bf 100644
--- a/tests/category_test.go
+++ b/tests/category_test.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
//go:build integration
// +build integration
diff --git a/tests/doc.go b/tests/doc.go
deleted file mode 100644
index 7c9975e7..00000000
--- a/tests/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package tests contains API integration tests.
-*/
-package tests // import "miniflux.app/tests"
diff --git a/tests/endpoint_test.go b/tests/endpoint_test.go
index 91871176..c864f9e1 100644
--- a/tests/endpoint_test.go
+++ b/tests/endpoint_test.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
//go:build integration
// +build integration
diff --git a/tests/entry_test.go b/tests/entry_test.go
index 97ce4cbe..8807c951 100644
--- a/tests/entry_test.go
+++ b/tests/entry_test.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
//go:build integration
// +build integration
diff --git a/tests/feed_test.go b/tests/feed_test.go
index a5ad4dad..7409a550 100644
--- a/tests/feed_test.go
+++ b/tests/feed_test.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
//go:build integration
// +build integration
diff --git a/tests/import_export_test.go b/tests/import_export_test.go
index 0233822f..b30e6acd 100644
--- a/tests/import_export_test.go
+++ b/tests/import_export_test.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
//go:build integration
// +build integration
diff --git a/tests/subscription_test.go b/tests/subscription_test.go
index b54f6ee7..01201097 100644
--- a/tests/subscription_test.go
+++ b/tests/subscription_test.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
//go:build integration
// +build integration
diff --git a/tests/tests.go b/tests/tests.go
index 27e7885d..56965ce6 100644
--- a/tests/tests.go
+++ b/tests/tests.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
//go:build integration
// +build integration
diff --git a/tests/user_test.go b/tests/user_test.go
index e8369f77..8b2fe8f3 100644
--- a/tests/user_test.go
+++ b/tests/user_test.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
//go:build integration
// +build integration
diff --git a/timer/doc.go b/timer/doc.go
deleted file mode 100644
index 216c08ca..00000000
--- a/timer/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package timer implements utility functions to measure the execution time of a block of code.
-*/
-package timer // import "miniflux.app/timer"
diff --git a/timer/timer.go b/timer/timer.go
index 8f311c3d..92c14970 100644
--- a/timer/timer.go
+++ b/timer/timer.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package timer // import "miniflux.app/timer"
diff --git a/timezone/doc.go b/timezone/doc.go
deleted file mode 100644
index d46da71c..00000000
--- a/timezone/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package timezone contains helper functions to work with timezones.
-*/
-package timezone // import "miniflux.app/timezone"
diff --git a/timezone/timezone.go b/timezone/timezone.go
index aaef655b..c14ae25e 100644
--- a/timezone/timezone.go
+++ b/timezone/timezone.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package timezone // import "miniflux.app/timezone"
diff --git a/timezone/timezone_test.go b/timezone/timezone_test.go
index ad62343d..0e8cfb94 100644
--- a/timezone/timezone_test.go
+++ b/timezone/timezone_test.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package timezone // import "miniflux.app/timezone"
diff --git a/ui/about.go b/ui/about.go
index c429ca52..3bfa554b 100644
--- a/ui/about.go
+++ b/ui/about.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/api_key_create.go b/ui/api_key_create.go
index c33f8d0e..68535089 100644
--- a/ui/api_key_create.go
+++ b/ui/api_key_create.go
@@ -1,6 +1,5 @@
-// Copyright 2020 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/api_key_list.go b/ui/api_key_list.go
index 0e6a8cd7..5fd1d0e3 100644
--- a/ui/api_key_list.go
+++ b/ui/api_key_list.go
@@ -1,6 +1,5 @@
-// Copyright 2020 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/api_key_remove.go b/ui/api_key_remove.go
index 7c1ceca8..50345478 100644
--- a/ui/api_key_remove.go
+++ b/ui/api_key_remove.go
@@ -1,6 +1,5 @@
-// Copyright 2020 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/api_key_save.go b/ui/api_key_save.go
index 4c7dfc59..84537385 100644
--- a/ui/api_key_save.go
+++ b/ui/api_key_save.go
@@ -1,6 +1,5 @@
-// Copyright 2020 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/bookmark_entries.go b/ui/bookmark_entries.go
index 225131d0..38815a4c 100644
--- a/ui/bookmark_entries.go
+++ b/ui/bookmark_entries.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -26,8 +25,7 @@ func (h *handler) showStarredPage(w http.ResponseWriter, r *http.Request) {
builder := h.store.NewEntryQueryBuilder(user.ID)
builder.WithoutStatus(model.EntryStatusRemoved)
builder.WithStarred(true)
- builder.WithOrder(user.EntryOrder)
- builder.WithDirection(user.EntryDirection)
+ builder.WithSorting(user.EntryOrder, user.EntryDirection)
builder.WithOffset(offset)
builder.WithLimit(user.EntriesPerPage)
diff --git a/ui/category_create.go b/ui/category_create.go
index c61b2407..506dc331 100644
--- a/ui/category_create.go
+++ b/ui/category_create.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/category_edit.go b/ui/category_edit.go
index 41673cc3..71fcbf2d 100644
--- a/ui/category_edit.go
+++ b/ui/category_edit.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/category_entries.go b/ui/category_entries.go
index c0889452..f3ee0a2f 100644
--- a/ui/category_entries.go
+++ b/ui/category_entries.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -37,8 +36,7 @@ func (h *handler) showCategoryEntriesPage(w http.ResponseWriter, r *http.Request
offset := request.QueryIntParam(r, "offset", 0)
builder := h.store.NewEntryQueryBuilder(user.ID)
builder.WithCategoryID(category.ID)
- builder.WithOrder(user.EntryOrder)
- builder.WithDirection(user.EntryDirection)
+ builder.WithSorting(user.EntryOrder, user.EntryDirection)
builder.WithStatus(model.EntryStatusUnread)
builder.WithOffset(offset)
builder.WithLimit(user.EntriesPerPage)
diff --git a/ui/category_entries_all.go b/ui/category_entries_all.go
index 84478251..fe860cf4 100644
--- a/ui/category_entries_all.go
+++ b/ui/category_entries_all.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -37,8 +36,7 @@ func (h *handler) showCategoryEntriesAllPage(w http.ResponseWriter, r *http.Requ
offset := request.QueryIntParam(r, "offset", 0)
builder := h.store.NewEntryQueryBuilder(user.ID)
builder.WithCategoryID(category.ID)
- builder.WithOrder(user.EntryOrder)
- builder.WithDirection(user.EntryDirection)
+ builder.WithSorting(user.EntryOrder, user.EntryDirection)
builder.WithoutStatus(model.EntryStatusRemoved)
builder.WithOffset(offset)
builder.WithLimit(user.EntriesPerPage)
diff --git a/ui/category_feeds.go b/ui/category_feeds.go
index cbcce7bd..7bec8419 100644
--- a/ui/category_feeds.go
+++ b/ui/category_feeds.go
@@ -1,6 +1,5 @@
-// Copyright 2019 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/category_list.go b/ui/category_list.go
index 1375888a..120d4dcd 100644
--- a/ui/category_list.go
+++ b/ui/category_list.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/category_mark_as_read.go b/ui/category_mark_as_read.go
index e7f12e37..aae83780 100644
--- a/ui/category_mark_as_read.go
+++ b/ui/category_mark_as_read.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/category_refresh.go b/ui/category_refresh.go
index 0b4689f9..9c871eea 100644
--- a/ui/category_refresh.go
+++ b/ui/category_refresh.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/category_remove.go b/ui/category_remove.go
index 8e616fc3..11080ece 100644
--- a/ui/category_remove.go
+++ b/ui/category_remove.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/category_save.go b/ui/category_save.go
index 6bf9d7df..c6f083ce 100644
--- a/ui/category_save.go
+++ b/ui/category_save.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/category_update.go b/ui/category_update.go
index 4475508b..f0e71274 100644
--- a/ui/category_update.go
+++ b/ui/category_update.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/doc.go b/ui/doc.go
deleted file mode 100644
index ea38fad6..00000000
--- a/ui/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package ui implements handlers to render to user interface.
-*/
-package ui // import "miniflux.app/ui"
diff --git a/ui/entry_bookmark.go b/ui/entry_bookmark.go
index 388c3643..d67ef0e9 100644
--- a/ui/entry_bookmark.go
+++ b/ui/entry_bookmark.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -39,7 +38,7 @@ func (h *handler) showStarredEntryPage(w http.ResponseWriter, r *http.Request) {
return
}
- if entry.Status == model.EntryStatusUnread {
+ if user.MarkReadOnView && entry.Status == model.EntryStatusUnread {
err = h.store.SetEntriesStatus(user.ID, []int64{entry.ID}, model.EntryStatusRead)
if err != nil {
html.ServerError(w, r, err)
diff --git a/ui/entry_category.go b/ui/entry_category.go
index f3df2224..a40ff09c 100644
--- a/ui/entry_category.go
+++ b/ui/entry_category.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -42,7 +41,7 @@ func (h *handler) showCategoryEntryPage(w http.ResponseWriter, r *http.Request)
return
}
- if entry.Status == model.EntryStatusUnread {
+ if user.MarkReadOnView && entry.Status == model.EntryStatusUnread {
err = h.store.SetEntriesStatus(user.ID, []int64{entry.ID}, model.EntryStatusRead)
if err != nil {
html.ServerError(w, r, err)
diff --git a/ui/entry_enclosure_save_position.go b/ui/entry_enclosure_save_position.go
new file mode 100644
index 00000000..91fd0078
--- /dev/null
+++ b/ui/entry_enclosure_save_position.go
@@ -0,0 +1,53 @@
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
+
+package ui // import "miniflux.app/ui"
+
+import (
+ json2 "encoding/json"
+ "io"
+ "net/http"
+
+ "miniflux.app/http/request"
+ "miniflux.app/http/response/json"
+)
+
+func (h *handler) saveEnclosureProgression(w http.ResponseWriter, r *http.Request) {
+ enclosureID := request.RouteInt64Param(r, "enclosureID")
+ enclosure, err := h.store.GetEnclosure(enclosureID)
+ if err != nil {
+ json.ServerError(w, r, err)
+ return
+ }
+
+ if enclosure == nil {
+ json.NotFound(w, r)
+ return
+ }
+
+ type enclosurePositionSaveRequest struct {
+ Progression int64 `json:"progression"`
+ }
+
+ var postData enclosurePositionSaveRequest
+ body, err := io.ReadAll(r.Body)
+ if err != nil {
+ json.ServerError(w, r, err)
+ return
+ }
+
+ json2.Unmarshal(body, &postData)
+ if err != nil {
+ json.ServerError(w, r, err)
+ return
+ }
+ enclosure.MediaProgression = postData.Progression
+
+ err = h.store.UpdateEnclosure(enclosure)
+ if err != nil {
+ json.ServerError(w, r, err)
+ return
+ }
+
+ json.Created(w, r, map[string]string{"message": "saved"})
+}
diff --git a/ui/entry_feed.go b/ui/entry_feed.go
index a331e2db..c1ce09d3 100644
--- a/ui/entry_feed.go
+++ b/ui/entry_feed.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -42,7 +41,7 @@ func (h *handler) showFeedEntryPage(w http.ResponseWriter, r *http.Request) {
return
}
- if entry.Status == model.EntryStatusUnread {
+ if user.MarkReadOnView && entry.Status == model.EntryStatusUnread {
err = h.store.SetEntriesStatus(user.ID, []int64{entry.ID}, model.EntryStatusRead)
if err != nil {
html.ServerError(w, r, err)
diff --git a/ui/entry_read.go b/ui/entry_read.go
index b61e64e7..3185b09d 100644
--- a/ui/entry_read.go
+++ b/ui/entry_read.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/entry_save.go b/ui/entry_save.go
index 43d25038..b467d68b 100644
--- a/ui/entry_save.go
+++ b/ui/entry_save.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/entry_scraper.go b/ui/entry_scraper.go
index 77755c74..ec9cfa9f 100644
--- a/ui/entry_scraper.go
+++ b/ui/entry_scraper.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/entry_search.go b/ui/entry_search.go
index 36a13e3b..de487259 100644
--- a/ui/entry_search.go
+++ b/ui/entry_search.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -41,7 +40,7 @@ func (h *handler) showSearchEntryPage(w http.ResponseWriter, r *http.Request) {
return
}
- if entry.Status == model.EntryStatusUnread {
+ if user.MarkReadOnView && entry.Status == model.EntryStatusUnread {
err = h.store.SetEntriesStatus(user.ID, []int64{entry.ID}, model.EntryStatusRead)
if err != nil {
html.ServerError(w, r, err)
diff --git a/ui/entry_toggle_bookmark.go b/ui/entry_toggle_bookmark.go
index 3e638a11..54cc416b 100644
--- a/ui/entry_toggle_bookmark.go
+++ b/ui/entry_toggle_bookmark.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/entry_unread.go b/ui/entry_unread.go
index 99033310..ba75e1e9 100644
--- a/ui/entry_unread.go
+++ b/ui/entry_unread.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -67,13 +66,18 @@ func (h *handler) showUnreadEntryPage(w http.ResponseWriter, r *http.Request) {
prevEntryRoute = route.Path(h.router, "unreadEntry", "entryID", prevEntry.ID)
}
- // Always mark the entry as read after fetching the pagination.
- err = h.store.SetEntriesStatus(user.ID, []int64{entry.ID}, model.EntryStatusRead)
- if err != nil {
- html.ServerError(w, r, err)
- return
+ if user.MarkReadOnView {
+ entry.Status = model.EntryStatusRead
+ }
+
+ // Restore entry read status if needed after fetching the pagination.
+ if entry.Status == model.EntryStatusRead {
+ err = h.store.SetEntriesStatus(user.ID, []int64{entry.ID}, model.EntryStatusRead)
+ if err != nil {
+ html.ServerError(w, r, err)
+ return
+ }
}
- entry.Status = model.EntryStatusRead
sess := session.New(h.store, request.SessionID(r))
view := view.New(h.tpl, r, sess)
diff --git a/ui/entry_update_status.go b/ui/entry_update_status.go
index d01ef678..f1228310 100644
--- a/ui/entry_update_status.go
+++ b/ui/entry_update_status.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/feed_edit.go b/ui/feed_edit.go
index ed9e5378..b13abc4f 100644
--- a/ui/feed_edit.go
+++ b/ui/feed_edit.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -59,6 +58,7 @@ func (h *handler) showEditFeedPage(w http.ResponseWriter, r *http.Request) {
AllowSelfSignedCertificates: feed.AllowSelfSignedCertificates,
FetchViaProxy: feed.FetchViaProxy,
Disabled: feed.Disabled,
+ NoMediaPlayer: feed.NoMediaPlayer,
HideGlobally: feed.HideGlobally,
CategoryHidden: feed.Category.HideGlobally,
}
diff --git a/ui/feed_entries.go b/ui/feed_entries.go
index fa975f78..7b93b8ff 100644
--- a/ui/feed_entries.go
+++ b/ui/feed_entries.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -38,8 +37,7 @@ func (h *handler) showFeedEntriesPage(w http.ResponseWriter, r *http.Request) {
builder := h.store.NewEntryQueryBuilder(user.ID)
builder.WithFeedID(feed.ID)
builder.WithStatus(model.EntryStatusUnread)
- builder.WithOrder(user.EntryOrder)
- builder.WithDirection(user.EntryDirection)
+ builder.WithSorting(user.EntryOrder, user.EntryDirection)
builder.WithOffset(offset)
builder.WithLimit(user.EntriesPerPage)
diff --git a/ui/feed_entries_all.go b/ui/feed_entries_all.go
index 0c42f8a0..6493d258 100644
--- a/ui/feed_entries_all.go
+++ b/ui/feed_entries_all.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -38,8 +37,7 @@ func (h *handler) showFeedEntriesAllPage(w http.ResponseWriter, r *http.Request)
builder := h.store.NewEntryQueryBuilder(user.ID)
builder.WithFeedID(feed.ID)
builder.WithoutStatus(model.EntryStatusRemoved)
- builder.WithOrder(user.EntryOrder)
- builder.WithDirection(user.EntryDirection)
+ builder.WithSorting(user.EntryOrder, user.EntryDirection)
builder.WithOffset(offset)
builder.WithLimit(user.EntriesPerPage)
diff --git a/ui/feed_icon.go b/ui/feed_icon.go
index 66c47075..093952d7 100644
--- a/ui/feed_icon.go
+++ b/ui/feed_icon.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/feed_list.go b/ui/feed_list.go
index 761c803e..1d218349 100644
--- a/ui/feed_list.go
+++ b/ui/feed_list.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/feed_mark_as_read.go b/ui/feed_mark_as_read.go
index fce5646a..65400a95 100644
--- a/ui/feed_mark_as_read.go
+++ b/ui/feed_mark_as_read.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/feed_refresh.go b/ui/feed_refresh.go
index 724e50cf..e8c5f353 100644
--- a/ui/feed_refresh.go
+++ b/ui/feed_refresh.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/feed_remove.go b/ui/feed_remove.go
index 15d997d2..3874d47a 100644
--- a/ui/feed_remove.go
+++ b/ui/feed_remove.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/feed_update.go b/ui/feed_update.go
index 183c30c6..e8080110 100644
--- a/ui/feed_update.go
+++ b/ui/feed_update.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/form/api_key.go b/ui/form/api_key.go
index a30dcb0b..b2a56991 100644
--- a/ui/form/api_key.go
+++ b/ui/form/api_key.go
@@ -1,6 +1,5 @@
-// Copyright 2020 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package form // import "miniflux.app/ui/form"
diff --git a/ui/form/auth.go b/ui/form/auth.go
index eed0ef5a..9d0ad884 100644
--- a/ui/form/auth.go
+++ b/ui/form/auth.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package form // import "miniflux.app/ui/form"
diff --git a/ui/form/category.go b/ui/form/category.go
index 0c013f4b..e7488c9f 100644
--- a/ui/form/category.go
+++ b/ui/form/category.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package form // import "miniflux.app/ui/form"
diff --git a/ui/form/doc.go b/ui/form/doc.go
deleted file mode 100644
index d81ce0fe..00000000
--- a/ui/form/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package form handles HTML form validation and serialization.
-*/
-package form // import "miniflux.app/ui/form"
diff --git a/ui/form/feed.go b/ui/form/feed.go
index 53181a7f..3a673379 100644
--- a/ui/form/feed.go
+++ b/ui/form/feed.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package form // import "miniflux.app/ui/form"
@@ -31,6 +30,7 @@ type FeedForm struct {
AllowSelfSignedCertificates bool
FetchViaProxy bool
Disabled bool
+ NoMediaPlayer bool
HideGlobally bool
CategoryHidden bool // Category has "hide_globally"
}
@@ -57,6 +57,7 @@ func (f FeedForm) Merge(feed *model.Feed) *model.Feed {
feed.AllowSelfSignedCertificates = f.AllowSelfSignedCertificates
feed.FetchViaProxy = f.FetchViaProxy
feed.Disabled = f.Disabled
+ feed.NoMediaPlayer = f.NoMediaPlayer
feed.HideGlobally = f.HideGlobally
return feed
}
@@ -86,6 +87,7 @@ func NewFeedForm(r *http.Request) *FeedForm {
AllowSelfSignedCertificates: r.FormValue("allow_self_signed_certificates") == "1",
FetchViaProxy: r.FormValue("fetch_via_proxy") == "1",
Disabled: r.FormValue("disabled") == "1",
+ NoMediaPlayer: r.FormValue("no_media_player") == "1",
HideGlobally: r.FormValue("hide_globally") == "1",
}
}
diff --git a/ui/form/integration.go b/ui/form/integration.go
index 07ad856a..f17ff89b 100644
--- a/ui/form/integration.go
+++ b/ui/form/integration.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package form // import "miniflux.app/ui/form"
@@ -48,6 +47,8 @@ type IntegrationForm struct {
LinkdingEnabled bool
LinkdingURL string
LinkdingAPIKey string
+ LinkdingTags string
+ LinkdingMarkAsUnread bool
MatrixBotEnabled bool
MatrixBotUser string
MatrixBotPassword string
@@ -91,6 +92,8 @@ func (i IntegrationForm) Merge(integration *model.Integration) {
integration.LinkdingEnabled = i.LinkdingEnabled
integration.LinkdingURL = i.LinkdingURL
integration.LinkdingAPIKey = i.LinkdingAPIKey
+ integration.LinkdingTags = i.LinkdingTags
+ integration.LinkdingMarkAsUnread = i.LinkdingMarkAsUnread
integration.MatrixBotEnabled = i.MatrixBotEnabled
integration.MatrixBotUser = i.MatrixBotUser
integration.MatrixBotPassword = i.MatrixBotPassword
@@ -137,6 +140,8 @@ func NewIntegrationForm(r *http.Request) *IntegrationForm {
LinkdingEnabled: r.FormValue("linkding_enabled") == "1",
LinkdingURL: r.FormValue("linkding_url"),
LinkdingAPIKey: r.FormValue("linkding_api_key"),
+ LinkdingTags: r.FormValue("linkding_tags"),
+ LinkdingMarkAsUnread: r.FormValue("linkding_mark_as_unread") == "1",
MatrixBotEnabled: r.FormValue("matrix_bot_enabled") == "1",
MatrixBotUser: r.FormValue("matrix_bot_user"),
MatrixBotPassword: r.FormValue("matrix_bot_password"),
diff --git a/ui/form/settings.go b/ui/form/settings.go
index 4a6c56e3..f8773997 100644
--- a/ui/form/settings.go
+++ b/ui/form/settings.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package form // import "miniflux.app/ui/form"
@@ -33,6 +32,7 @@ type SettingsForm struct {
CJKReadingSpeed int
DefaultHomePage string
CategoriesSortingOrder string
+ MarkReadOnView bool
}
// Merge updates the fields of the given user.
@@ -54,6 +54,7 @@ func (s *SettingsForm) Merge(user *model.User) *model.User {
user.DefaultReadingSpeed = s.DefaultReadingSpeed
user.DefaultHomePage = s.DefaultHomePage
user.CategoriesSortingOrder = s.CategoriesSortingOrder
+ user.MarkReadOnView = s.MarkReadOnView
if s.Password != "" {
user.Password = s.Password
@@ -120,5 +121,6 @@ func NewSettingsForm(r *http.Request) *SettingsForm {
CJKReadingSpeed: int(cjkReadingSpeed),
DefaultHomePage: r.FormValue("default_home_page"),
CategoriesSortingOrder: r.FormValue("categories_sorting_order"),
+ MarkReadOnView: r.FormValue("mark_read_on_view") == "1",
}
}
diff --git a/ui/form/settings_test.go b/ui/form/settings_test.go
index 655c9fe2..3a58c838 100644
--- a/ui/form/settings_test.go
+++ b/ui/form/settings_test.go
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
+
package form // import "miniflux.app/ui/form"
import (
diff --git a/ui/form/subscription.go b/ui/form/subscription.go
index 642c9534..4a36f792 100644
--- a/ui/form/subscription.go
+++ b/ui/form/subscription.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package form // import "miniflux.app/ui/form"
diff --git a/ui/form/user.go b/ui/form/user.go
index 7abaeca7..ed626f29 100644
--- a/ui/form/user.go
+++ b/ui/form/user.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package form // import "miniflux.app/ui/form"
diff --git a/ui/handler.go b/ui/handler.go
index 1bfc3dae..78600ea0 100644
--- a/ui/handler.go
+++ b/ui/handler.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/history_entries.go b/ui/history_entries.go
index efeb1d57..c5275105 100644
--- a/ui/history_entries.go
+++ b/ui/history_entries.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -25,8 +24,8 @@ func (h *handler) showHistoryPage(w http.ResponseWriter, r *http.Request) {
offset := request.QueryIntParam(r, "offset", 0)
builder := h.store.NewEntryQueryBuilder(user.ID)
builder.WithStatus(model.EntryStatusRead)
- builder.WithOrder("changed_at")
- builder.WithDirection("desc")
+ builder.WithSorting("changed_at", "DESC")
+ builder.WithSorting("published_at", "DESC")
builder.WithOffset(offset)
builder.WithLimit(user.EntriesPerPage)
diff --git a/ui/history_flush.go b/ui/history_flush.go
index e74c5b97..8a8a1203 100644
--- a/ui/history_flush.go
+++ b/ui/history_flush.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/integration_pocket.go b/ui/integration_pocket.go
index 3e771878..7d2d476c 100644
--- a/ui/integration_pocket.go
+++ b/ui/integration_pocket.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/integration_show.go b/ui/integration_show.go
index afd0bfd5..c51d8965 100644
--- a/ui/integration_show.go
+++ b/ui/integration_show.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -63,6 +62,8 @@ func (h *handler) showIntegrationPage(w http.ResponseWriter, r *http.Request) {
LinkdingEnabled: integration.LinkdingEnabled,
LinkdingURL: integration.LinkdingURL,
LinkdingAPIKey: integration.LinkdingAPIKey,
+ LinkdingTags: integration.LinkdingTags,
+ LinkdingMarkAsUnread: integration.LinkdingMarkAsUnread,
MatrixBotEnabled: integration.MatrixBotEnabled,
MatrixBotUser: integration.MatrixBotUser,
MatrixBotPassword: integration.MatrixBotPassword,
diff --git a/ui/integration_update.go b/ui/integration_update.go
index d5380c93..30f1824f 100644
--- a/ui/integration_update.go
+++ b/ui/integration_update.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/login_check.go b/ui/login_check.go
index fbafc58f..cdd7417b 100644
--- a/ui/login_check.go
+++ b/ui/login_check.go
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
+
package ui // import "miniflux.app/ui"
import (
diff --git a/ui/login_show.go b/ui/login_show.go
index d6abd2f6..81be88cc 100644
--- a/ui/login_show.go
+++ b/ui/login_show.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/logout.go b/ui/logout.go
index 479426b5..34dfe000 100644
--- a/ui/logout.go
+++ b/ui/logout.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/middleware.go b/ui/middleware.go
index 31a912ab..72334088 100644
--- a/ui/middleware.go
+++ b/ui/middleware.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/oauth2.go b/ui/oauth2.go
index 045d9cbc..7cf5aa3d 100644
--- a/ui/oauth2.go
+++ b/ui/oauth2.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/oauth2_callback.go b/ui/oauth2_callback.go
index cd033f86..ac1e19e8 100644
--- a/ui/oauth2_callback.go
+++ b/ui/oauth2_callback.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/oauth2_redirect.go b/ui/oauth2_redirect.go
index b2fe9bc8..fb24df37 100644
--- a/ui/oauth2_redirect.go
+++ b/ui/oauth2_redirect.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/oauth2_unlink.go b/ui/oauth2_unlink.go
index 46cc0df6..fa2f51bd 100644
--- a/ui/oauth2_unlink.go
+++ b/ui/oauth2_unlink.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/offline.go b/ui/offline.go
index b6c4dff7..da04e910 100644
--- a/ui/offline.go
+++ b/ui/offline.go
@@ -1,6 +1,5 @@
-// Copyright 2021 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/opml_export.go b/ui/opml_export.go
index 4eb6d2c9..a7b14161 100644
--- a/ui/opml_export.go
+++ b/ui/opml_export.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/opml_import.go b/ui/opml_import.go
index ea6b3626..0f7bbac0 100644
--- a/ui/opml_import.go
+++ b/ui/opml_import.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/opml_upload.go b/ui/opml_upload.go
index 08430737..bebab3e8 100644
--- a/ui/opml_upload.go
+++ b/ui/opml_upload.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/pagination.go b/ui/pagination.go
index 46e0a397..395e1714 100644
--- a/ui/pagination.go
+++ b/ui/pagination.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/proxy.go b/ui/proxy.go
index bffbc939..a21d75f5 100644
--- a/ui/proxy.go
+++ b/ui/proxy.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/search_entries.go b/ui/search_entries.go
index 5dfd6db7..28f648ac 100644
--- a/ui/search_entries.go
+++ b/ui/search_entries.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/session/doc.go b/ui/session/doc.go
deleted file mode 100644
index 617a69b8..00000000
--- a/ui/session/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package session provides helper functions to work with the user session.
-*/
-package session // import "miniflux.app/ui/session"
diff --git a/ui/session/session.go b/ui/session/session.go
index 0874f927..b0756daf 100644
--- a/ui/session/session.go
+++ b/ui/session/session.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package session // import "miniflux.app/ui/session"
diff --git a/ui/session_list.go b/ui/session_list.go
index 53051b2b..2db9e1cf 100644
--- a/ui/session_list.go
+++ b/ui/session_list.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/session_remove.go b/ui/session_remove.go
index 7e57b82f..024ebdf2 100644
--- a/ui/session_remove.go
+++ b/ui/session_remove.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/settings_show.go b/ui/settings_show.go
index 7b04d4e0..39700d17 100644
--- a/ui/settings_show.go
+++ b/ui/settings_show.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -44,6 +43,7 @@ func (h *handler) showSettingsPage(w http.ResponseWriter, r *http.Request) {
CJKReadingSpeed: user.CJKReadingSpeed,
DefaultHomePage: user.DefaultHomePage,
CategoriesSortingOrder: user.CategoriesSortingOrder,
+ MarkReadOnView: user.MarkReadOnView,
}
timezones, err := h.store.Timezones()
diff --git a/ui/settings_update.go b/ui/settings_update.go
index ce516eb6..5d0b0d1c 100644
--- a/ui/settings_update.go
+++ b/ui/settings_update.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/share.go b/ui/share.go
index 6d3ff6e4..0ee405da 100644
--- a/ui/share.go
+++ b/ui/share.go
@@ -1,6 +1,5 @@
-// Copyright 2020 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/shared_entries.go b/ui/shared_entries.go
index da84eeb2..3a00cbe7 100644
--- a/ui/shared_entries.go
+++ b/ui/shared_entries.go
@@ -1,6 +1,5 @@
-// Copyright 2020 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -22,8 +21,7 @@ func (h *handler) sharedEntries(w http.ResponseWriter, r *http.Request) {
builder := h.store.NewEntryQueryBuilder(user.ID)
builder.WithShareCodeNotEmpty()
- builder.WithOrder(user.EntryOrder)
- builder.WithDirection(user.EntryDirection)
+ builder.WithSorting(user.EntryOrder, user.EntryDirection)
entries, err := builder.GetEntries()
if err != nil {
diff --git a/ui/static/bin/maskable-icon-120.png b/ui/static/bin/maskable-icon-120.png
new file mode 100644
index 00000000..7f30c5b3
Binary files /dev/null and b/ui/static/bin/maskable-icon-120.png differ
diff --git a/ui/static/bin/maskable-icon-192.png b/ui/static/bin/maskable-icon-192.png
new file mode 100644
index 00000000..975fc13e
Binary files /dev/null and b/ui/static/bin/maskable-icon-192.png differ
diff --git a/ui/static/bin/maskable-icon-512.png b/ui/static/bin/maskable-icon-512.png
new file mode 100644
index 00000000..c8ee563e
Binary files /dev/null and b/ui/static/bin/maskable-icon-512.png differ
diff --git a/ui/static/css/common.css b/ui/static/css/common.css
index cd61f912..cc213c9b 100644
--- a/ui/static/css/common.css
+++ b/ui/static/css/common.css
@@ -216,7 +216,7 @@ a:hover {
100% {visibility: hidden; opacity: 0; z-index: 0}
}
-@media (min-width: 600px) {
+@media (min-width: 620px) {
body {
margin: auto;
max-width: 750px;
@@ -734,15 +734,11 @@ template {
font-size: 0.85em;
}
-.item-meta-info li:after {
+.item-meta-info li:not(:last-child):after {
content: "|";
color: var(--item-meta-li-color);
}
-.item-meta-info li:last-child:after {
- content: "";
-}
-
.item-meta-icons li {
margin-right: 8px;
margin-top: 4px;
@@ -854,6 +850,15 @@ article.category-has-unread {
overflow-wrap: break-word;
}
+.entry-tags {
+ margin-top: 20px;
+ margin-bottom: 20px;
+}
+
+.entry-tags strong {
+ font-weight: 600;
+}
+
.entry-website img {
vertical-align: top;
}
@@ -1085,3 +1090,7 @@ details.entry-enclosures {
.disabled {
opacity: 20%;
}
+
+audio,video {
+ width: 100%;
+}
diff --git a/ui/static/doc.go b/ui/static/doc.go
deleted file mode 100644
index b1725468..00000000
--- a/ui/static/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package static contains assets for the user interface.
-*/
-package static // import "miniflux.app/ui/static"
diff --git a/ui/static/js/app.js b/ui/static/js/app.js
index b8082fc8..308a22b7 100644
--- a/ui/static/js/app.js
+++ b/ui/static/js/app.js
@@ -618,3 +618,23 @@ function showToast(label, iconElement) {
function goToAddSubscription() {
window.location.href = document.body.dataset.addSubscriptionUrl;
}
+
+/**
+ * save player position to allow to resume playback later
+ * @param {Element} playerElement
+ */
+function handlePlayerProgressionSave(playerElement) {
+ const currentPositionInSeconds = Math.floor(playerElement.currentTime); // we do not need a precise value
+ const lastKnownPositionInSeconds = parseInt(playerElement.dataset.lastPosition, 10);
+ const recordInterval = 10;
+
+ // we limit the number of update to only one by interval. Otherwise, we would have multiple update per seconds
+ if (currentPositionInSeconds >= (lastKnownPositionInSeconds + recordInterval) ||
+ currentPositionInSeconds <= (lastKnownPositionInSeconds - recordInterval)
+ ) {
+ playerElement.dataset.lastPosition = currentPositionInSeconds.toString();
+ let request = new RequestBuilder(playerElement.dataset.saveUrl);
+ request.withBody({progression: currentPositionInSeconds});
+ request.execute();
+ }
+}
diff --git a/ui/static/js/bootstrap.js b/ui/static/js/bootstrap.js
index b4c46017..be68225b 100644
--- a/ui/static/js/bootstrap.js
+++ b/ui/static/js/bootstrap.js
@@ -69,10 +69,10 @@ document.addEventListener("DOMContentLoaded", function () {
request.execute();
}));
- onClick("a[data-original-link]", (event) => {
+ onClick("a[data-original-link='true']", (event) => {
handleEntryStatus("next", event.target, true);
}, true);
- onAuxClick("a[data-original-link]", (event) => {
+ onAuxClick("a[data-original-link='true']", (event) => {
if (event.button == 1) {
handleEntryStatus("next", event.target, true);
}
@@ -112,4 +112,12 @@ document.addEventListener("DOMContentLoaded", function () {
}
}
});
+
+ // enclosure media player position save & resume
+ const elements = document.querySelectorAll("audio[data-last-position],video[data-last-position]");
+ elements.forEach((element) => {
+ // we set the current time of media players
+ if (element.dataset.lastPosition){ element.currentTime = element.dataset.lastPosition; }
+ element.ontimeupdate = () => handlePlayerProgressionSave(element);
+ });
});
diff --git a/ui/static/static.go b/ui/static/static.go
index 5f1bd003..0201cc98 100644
--- a/ui/static/static.go
+++ b/ui/static/static.go
@@ -1,6 +1,5 @@
-// Copyright 2021 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package static // import "miniflux.app/ui/static"
diff --git a/ui/static_app_icon.go b/ui/static_app_icon.go
index 46b16fe2..40f41011 100644
--- a/ui/static_app_icon.go
+++ b/ui/static_app_icon.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/static_favicon.go b/ui/static_favicon.go
index 1f158fd2..426fa52d 100644
--- a/ui/static_favicon.go
+++ b/ui/static_favicon.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/static_javascript.go b/ui/static_javascript.go
index 99255d84..a722c868 100644
--- a/ui/static_javascript.go
+++ b/ui/static_javascript.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/static_manifest.go b/ui/static_manifest.go
index b1a5284d..5f2424f9 100644
--- a/ui/static_manifest.go
+++ b/ui/static_manifest.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -27,9 +26,10 @@ func (h *handler) showWebManifest(w http.ResponseWriter, r *http.Request) {
}
type webManifestIcon struct {
- Source string `json:"src"`
- Sizes string `json:"sizes"`
- Type string `json:"type"`
+ Source string `json:"src"`
+ Sizes string `json:"sizes"`
+ Type string `json:"type"`
+ Purpose string `json:"purpose"`
}
type webManifest struct {
@@ -63,9 +63,12 @@ func (h *handler) showWebManifest(w http.ResponseWriter, r *http.Request) {
ThemeColor: themeColor,
BackgroundColor: themeColor,
Icons: []webManifestIcon{
- {Source: route.Path(h.router, "appIcon", "filename", "icon-120.png"), Sizes: "120x120", Type: "image/png"},
- {Source: route.Path(h.router, "appIcon", "filename", "icon-192.png"), Sizes: "192x192", Type: "image/png"},
- {Source: route.Path(h.router, "appIcon", "filename", "icon-512.png"), Sizes: "512x512", Type: "image/png"},
+ {Source: route.Path(h.router, "appIcon", "filename", "icon-120.png"), Sizes: "120x120", Type: "image/png", Purpose: "any"},
+ {Source: route.Path(h.router, "appIcon", "filename", "icon-192.png"), Sizes: "192x192", Type: "image/png", Purpose: "any"},
+ {Source: route.Path(h.router, "appIcon", "filename", "icon-512.png"), Sizes: "512x512", Type: "image/png", Purpose: "any"},
+ {Source: route.Path(h.router, "appIcon", "filename", "maskable-icon-120.png"), Sizes: "120x120", Type: "image/png", Purpose: "maskable"},
+ {Source: route.Path(h.router, "appIcon", "filename", "maskable-icon-192.png"), Sizes: "192x192", Type: "image/png", Purpose: "maskable"},
+ {Source: route.Path(h.router, "appIcon", "filename", "maskable-icon-512.png"), Sizes: "512x512", Type: "image/png", Purpose: "maskable"},
},
ShareTarget: webManifestShareTarget{
Action: route.Path(h.router, "bookmarklet"),
diff --git a/ui/static_stylesheet.go b/ui/static_stylesheet.go
index 8b67e306..f95e2ddf 100644
--- a/ui/static_stylesheet.go
+++ b/ui/static_stylesheet.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/subscription_add.go b/ui/subscription_add.go
index 5062c908..d42aabe6 100644
--- a/ui/subscription_add.go
+++ b/ui/subscription_add.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/subscription_bookmarklet.go b/ui/subscription_bookmarklet.go
index 01e4a8cc..38b09123 100644
--- a/ui/subscription_bookmarklet.go
+++ b/ui/subscription_bookmarklet.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/subscription_choose.go b/ui/subscription_choose.go
index 6d106330..d4b0e9a2 100644
--- a/ui/subscription_choose.go
+++ b/ui/subscription_choose.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/subscription_submit.go b/ui/subscription_submit.go
index 21b03f3f..ce88c0fc 100644
--- a/ui/subscription_submit.go
+++ b/ui/subscription_submit.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/ui.go b/ui/ui.go
index 15f5da78..969bf975 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -95,6 +94,7 @@ func Serve(router *mux.Router, store *storage.Storage, pool *worker.Pool) {
// Entry pages.
uiRouter.HandleFunc("/entry/status", handler.updateEntriesStatus).Name("updateEntriesStatus").Methods(http.MethodPost)
uiRouter.HandleFunc("/entry/save/{entryID}", handler.saveEntry).Name("saveEntry").Methods(http.MethodPost)
+ uiRouter.HandleFunc("/entry/enclosure/{enclosureID}/save-progression", handler.saveEnclosureProgression).Name("saveEnclosureProgression").Methods(http.MethodPost)
uiRouter.HandleFunc("/entry/download/{entryID}", handler.fetchContent).Name("fetchContent").Methods(http.MethodPost)
uiRouter.HandleFunc("/proxy/{encodedDigest}/{encodedURL}", handler.mediaProxy).Name("proxy").Methods(http.MethodGet)
uiRouter.HandleFunc("/entry/bookmark/{entryID}", handler.toggleBookmark).Name("toggleBookmark").Methods(http.MethodPost)
diff --git a/ui/unread_entries.go b/ui/unread_entries.go
index ed22eae9..5fe1ab2b 100644
--- a/ui/unread_entries.go
+++ b/ui/unread_entries.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -49,8 +48,7 @@ func (h *handler) showUnreadPage(w http.ResponseWriter, r *http.Request) {
beginSqlFetchUnreadEntries := time.Now()
builder = h.store.NewEntryQueryBuilder(user.ID)
builder.WithStatus(model.EntryStatusUnread)
- builder.WithOrder(user.EntryOrder)
- builder.WithDirection(user.EntryDirection)
+ builder.WithSorting(user.EntryOrder, user.EntryDirection)
builder.WithOffset(offset)
builder.WithLimit(user.EntriesPerPage)
builder.WithGloballyVisible()
diff --git a/ui/unread_mark_all_read.go b/ui/unread_mark_all_read.go
index 3952063b..54effa16 100644
--- a/ui/unread_mark_all_read.go
+++ b/ui/unread_mark_all_read.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
@@ -12,7 +11,7 @@ import (
)
func (h *handler) markAllAsRead(w http.ResponseWriter, r *http.Request) {
- if err := h.store.MarkAllAsRead(request.UserID(r)); err != nil {
+ if err := h.store.MarkGloballyVisibleFeedsAsRead(request.UserID(r)); err != nil {
json.ServerError(w, r, err)
return
}
diff --git a/ui/user_create.go b/ui/user_create.go
index a30f3346..e8d3d408 100644
--- a/ui/user_create.go
+++ b/ui/user_create.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/user_edit.go b/ui/user_edit.go
index 23f577db..f675f4b7 100644
--- a/ui/user_edit.go
+++ b/ui/user_edit.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/user_list.go b/ui/user_list.go
index 6c19de41..9e9cce31 100644
--- a/ui/user_list.go
+++ b/ui/user_list.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/user_remove.go b/ui/user_remove.go
index 70536fe9..e6cc9847 100644
--- a/ui/user_remove.go
+++ b/ui/user_remove.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/user_save.go b/ui/user_save.go
index 45b9e84a..49827def 100644
--- a/ui/user_save.go
+++ b/ui/user_save.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/user_update.go b/ui/user_update.go
index 8d6be865..abdbe925 100644
--- a/ui/user_update.go
+++ b/ui/user_update.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package ui // import "miniflux.app/ui"
diff --git a/ui/view/doc.go b/ui/view/doc.go
deleted file mode 100644
index ed32f41f..00000000
--- a/ui/view/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package view handles template parameters.
-*/
-package view // import "miniflux.app/ui/view"
diff --git a/ui/view/view.go b/ui/view/view.go
index fd7df2c4..d63deefa 100644
--- a/ui/view/view.go
+++ b/ui/view/view.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package view // import "miniflux.app/ui/view"
diff --git a/url/doc.go b/url/doc.go
deleted file mode 100644
index 2204b955..00000000
--- a/url/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package url implements a set of utility functions to parse URL.
-*/
-package url // import "miniflux.app/url"
diff --git a/url/url.go b/url/url.go
index 859afc87..2806572a 100644
--- a/url/url.go
+++ b/url/url.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package url // import "miniflux.app/url"
diff --git a/url/url_test.go b/url/url_test.go
index 7aa1cf98..5d3d2ccc 100644
--- a/url/url_test.go
+++ b/url/url_test.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package url // import "miniflux.app/url"
diff --git a/validator/category.go b/validator/category.go
index 9a62b4e0..b4255176 100644
--- a/validator/category.go
+++ b/validator/category.go
@@ -1,6 +1,5 @@
-// Copyright 2021 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package validator // import "miniflux.app/validator"
diff --git a/validator/entry.go b/validator/entry.go
index c7a96acb..2d4c7eb2 100644
--- a/validator/entry.go
+++ b/validator/entry.go
@@ -1,6 +1,5 @@
-// Copyright 2021 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package validator // import "miniflux.app/validator"
diff --git a/validator/entry_test.go b/validator/entry_test.go
index 3d580454..2022ad71 100644
--- a/validator/entry_test.go
+++ b/validator/entry_test.go
@@ -1,6 +1,5 @@
-// Copyright 2021 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package validator // import "miniflux.app/validator"
diff --git a/validator/feed.go b/validator/feed.go
index 614b688e..89f086ca 100644
--- a/validator/feed.go
+++ b/validator/feed.go
@@ -1,6 +1,5 @@
-// Copyright 2021 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package validator // import "miniflux.app/validator"
diff --git a/validator/subscription.go b/validator/subscription.go
index a907f4fe..adfda342 100644
--- a/validator/subscription.go
+++ b/validator/subscription.go
@@ -1,6 +1,5 @@
-// Copyright 2021 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package validator // import "miniflux.app/validator"
diff --git a/validator/user.go b/validator/user.go
index f7f271c0..7a552ee7 100644
--- a/validator/user.go
+++ b/validator/user.go
@@ -1,6 +1,5 @@
-// Copyright 2021 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package validator // import "miniflux.app/validator"
diff --git a/validator/validator.go b/validator/validator.go
index 5ebaef88..4ef0a586 100644
--- a/validator/validator.go
+++ b/validator/validator.go
@@ -1,6 +1,5 @@
-// Copyright 2021 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package validator // import "miniflux.app/validator"
diff --git a/validator/validator_test.go b/validator/validator_test.go
index 6f26f660..fd72b4f9 100644
--- a/validator/validator_test.go
+++ b/validator/validator_test.go
@@ -1,6 +1,5 @@
-// Copyright 2021 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package validator // import "miniflux.app/validator"
diff --git a/version/doc.go b/version/doc.go
deleted file mode 100644
index 58d1bc0b..00000000
--- a/version/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package version contains application and build information.
-*/
-package version // import "miniflux.app/version"
diff --git a/version/version.go b/version/version.go
index 0b1a4b2b..c4494048 100644
--- a/version/version.go
+++ b/version/version.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package version // import "miniflux.app/version"
diff --git a/worker/doc.go b/worker/doc.go
deleted file mode 100644
index 909b34d8..00000000
--- a/worker/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-/*
-Package worker implements the background workers.
-*/
-package worker // import "miniflux.app/worker"
diff --git a/worker/pool.go b/worker/pool.go
index bcd075fd..b914cc20 100644
--- a/worker/pool.go
+++ b/worker/pool.go
@@ -1,6 +1,5 @@
-// Copyright 2018 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package worker // import "miniflux.app/worker"
diff --git a/worker/worker.go b/worker/worker.go
index 192cae50..2b3b473e 100644
--- a/worker/worker.go
+++ b/worker/worker.go
@@ -1,6 +1,5 @@
-// Copyright 2017 Frédéric Guillot. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
+// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
+// SPDX-License-Identifier: Apache-2.0
package worker // import "miniflux.app/worker"