mirror of
https://github.com/nkanaev/yarr.git
synced 2025-11-07 01:50:38 +00:00
Compare commits
3 Commits
08ad04401d
...
16a7f3409c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16a7f3409c | ||
|
|
0e11cec99a | ||
|
|
c158912da4 |
@@ -3,6 +3,7 @@
|
|||||||
- (new) serve on unix socket (thanks to @rvighne)
|
- (new) serve on unix socket (thanks to @rvighne)
|
||||||
- (new) more auto-refresh options: 12h & 24h (thanks to @aswerkljh for suggestion)
|
- (new) more auto-refresh options: 12h & 24h (thanks to @aswerkljh for suggestion)
|
||||||
- (fix) smooth scrolling on iOS (thanks to gatheraled)
|
- (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) theme-color support (thanks to @asimpson)
|
||||||
- (etc) cookie security measures (thanks to Tom Fitzhenry)
|
- (etc) cookie security measures (thanks to Tom Fitzhenry)
|
||||||
- (etc) restrict access to internal IPs for page crawler (thanks to Omar Kurt)
|
- (etc) restrict access to internal IPs for page crawler (thanks to Omar Kurt)
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"fmt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type assetsfs struct {
|
type assetsfs struct {
|
||||||
@@ -20,10 +19,8 @@ var FS assetsfs
|
|||||||
|
|
||||||
func (afs assetsfs) Open(name string) (fs.File, error) {
|
func (afs assetsfs) Open(name string) (fs.File, error) {
|
||||||
if afs.embedded != nil {
|
if afs.embedded != nil {
|
||||||
fmt.Println("serving from embedded")
|
|
||||||
return afs.embedded.Open(name)
|
return afs.embedded.Open(name)
|
||||||
}
|
}
|
||||||
fmt.Println("serving local")
|
|
||||||
return os.DirFS("src/assets").Open(name)
|
return os.DirFS("src/assets").Open(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ func VideoIFrame(link string) string {
|
|||||||
youtubeID := ""
|
youtubeID := ""
|
||||||
if l.Host == "www.youtube.com" && l.Path == "/watch" {
|
if l.Host == "www.youtube.com" && l.Path == "/watch" {
|
||||||
youtubeID = l.Query().Get("v")
|
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" {
|
} else if l.Host == "youtu.be" {
|
||||||
youtubeID = strings.TrimLeft(l.Path, "/")
|
youtubeID = strings.TrimLeft(l.Path, "/")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,10 +54,14 @@ type MediaLink struct {
|
|||||||
type MediaLinks []MediaLink
|
type MediaLinks []MediaLink
|
||||||
|
|
||||||
func (m *MediaLinks) Scan(src any) error {
|
func (m *MediaLinks) Scan(src any) error {
|
||||||
if data, ok := src.([]byte); ok {
|
switch data := src.(type) {
|
||||||
|
case []byte:
|
||||||
return json.Unmarshal(data, m)
|
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) {
|
func (m MediaLinks) Value() (driver.Value, error) {
|
||||||
@@ -419,7 +423,6 @@ func (s *Storage) DeleteOldItems() {
|
|||||||
where status != ?
|
where status != ?
|
||||||
group by i.feed_id
|
group by i.feed_id
|
||||||
`, itemsKeepSize, STARRED)
|
`, itemsKeepSize, STARRED)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print(err)
|
log.Print(err)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user