mirror of
https://github.com/nkanaev/yarr.git
synced 2025-11-07 01:50:38 +00:00
Compare commits
5 Commits
5a3547e32e
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16a7f3409c | ||
|
|
0e11cec99a | ||
|
|
c158912da4 | ||
|
|
08ad04401d | ||
|
|
a851d8ac9d |
@@ -3,6 +3,8 @@
|
||||
- (new) serve on unix socket (thanks to @rvighne)
|
||||
- (new) more auto-refresh options: 12h & 24h (thanks to @aswerkljh for suggestion)
|
||||
- (fix) smooth scrolling on iOS (thanks to gatheraled)
|
||||
- (fix) displaying youtube shorts in "Read Here" (thanks to @Dean-Corso for the report)
|
||||
- (etc) theme-color support (thanks to @asimpson)
|
||||
- (etc) cookie security measures (thanks to Tom Fitzhenry)
|
||||
- (etc) restrict access to internal IPs for page crawler (thanks to Omar Kurt)
|
||||
|
||||
|
||||
3
makefile
3
makefile
@@ -5,6 +5,7 @@ GO_TAGS = sqlite_foreign_keys sqlite_json
|
||||
GO_LDFLAGS = -s -w -X 'main.Version=$(VERSION)' -X 'main.GitHash=$(GITHASH)'
|
||||
|
||||
GO_FLAGS = -tags "$(GO_TAGS)" -ldflags="$(GO_LDFLAGS)"
|
||||
GO_FLAGS_DEBUG = -tags "$(GO_TAGS) debug"
|
||||
GO_FLAGS_GUI = -tags "$(GO_TAGS) gui" -ldflags="$(GO_LDFLAGS)"
|
||||
GO_FLAGS_GUI_WIN = -tags "$(GO_TAGS) gui" -ldflags="$(GO_LDFLAGS) -H windowsgui"
|
||||
|
||||
@@ -75,7 +76,7 @@ windows_arm64_gui: src/platform/versioninfo.rc
|
||||
GOOS=windows GOARCH=arm64 go build $(GO_FLAGS_GUI_WIN) -o out/$@/yarr.exe ./cmd/yarr
|
||||
|
||||
serve:
|
||||
go run $(GO_FLAGS) ./cmd/yarr -db local.db
|
||||
go run $(GO_FLAGS_DEBUG) ./cmd/yarr -db local.db
|
||||
|
||||
test:
|
||||
go test $(GO_FLAGS) ./...
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
//go:build !debug
|
||||
|
||||
package assets
|
||||
|
||||
import "embed"
|
||||
|
||||
@@ -24,21 +24,21 @@
|
||||
<div class="p-2 toolbar d-flex align-items-center">
|
||||
<div class="icon mx-2">{% inline "anchor.svg" %}</div>
|
||||
<div class="flex-grow-1"></div>
|
||||
<button class="toolbar-item"
|
||||
<button class="toolbar-item ml-1"
|
||||
:class="{active: filterSelected == 'unread'}"
|
||||
:aria-pressed="filterSelected == 'unread'"
|
||||
title="Unread"
|
||||
@click="filterSelected = 'unread'">
|
||||
<span class="icon">{% inline "circle-full.svg" %}</span>
|
||||
</button>
|
||||
<button class="toolbar-item"
|
||||
<button class="toolbar-item mx-1"
|
||||
:class="{active: filterSelected == 'starred'}"
|
||||
:aria-pressed="filterSelected == 'starred'"
|
||||
title="Starred"
|
||||
@click="filterSelected = 'starred'">
|
||||
<span class="icon">{% inline "star-full.svg" %}</span>
|
||||
</button>
|
||||
<button class="toolbar-item"
|
||||
<button class="toolbar-item mr-1"
|
||||
:class="{active: filterSelected == ''}"
|
||||
:aria-pressed="filterSelected == ''"
|
||||
title="All"
|
||||
|
||||
@@ -22,6 +22,8 @@ func VideoIFrame(link string) string {
|
||||
youtubeID := ""
|
||||
if l.Host == "www.youtube.com" && l.Path == "/watch" {
|
||||
youtubeID = l.Query().Get("v")
|
||||
} else if l.Host == "www.youtube.com" && strings.HasPrefix(l.Path, "/shorts/") {
|
||||
youtubeID = strings.TrimPrefix(l.Path, "/shorts/")
|
||||
} else if l.Host == "youtu.be" {
|
||||
youtubeID = strings.TrimLeft(l.Path, "/")
|
||||
}
|
||||
|
||||
@@ -54,10 +54,14 @@ type MediaLink struct {
|
||||
type MediaLinks []MediaLink
|
||||
|
||||
func (m *MediaLinks) Scan(src any) error {
|
||||
if data, ok := src.([]byte); ok {
|
||||
switch data := src.(type) {
|
||||
case []byte:
|
||||
return json.Unmarshal(data, m)
|
||||
case string:
|
||||
return json.Unmarshal([]byte(data), m)
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m MediaLinks) Value() (driver.Value, error) {
|
||||
@@ -419,7 +423,6 @@ func (s *Storage) DeleteOldItems() {
|
||||
where status != ?
|
||||
group by i.feed_id
|
||||
`, itemsKeepSize, STARRED)
|
||||
|
||||
if err != nil {
|
||||
log.Print(err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user