From 0e8244b3cc7deb0f64a3600a6fe9d67cabe4bcb9 Mon Sep 17 00:00:00 2001 From: Laptop Date: Fri, 22 Nov 2024 23:33:13 +0200 Subject: [PATCH] change buttons layout (so it looks ok on mobile) and catch "broken pipe" in sc.DoWithRetry --- assets/global.css | 7 +++++-- assets/index.html | 20 ++++++++++---------- lib/sc/init.go | 3 ++- templates/track.templ | 3 ++- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/assets/global.css b/assets/global.css index 837f5df..742d6a2 100644 --- a/assets/global.css +++ b/assets/global.css @@ -62,6 +62,7 @@ input:focus { cursor: pointer; padding: 0.5rem 0.75rem; display: block; + text-align: center; } .btn:hover, @@ -135,7 +136,8 @@ details > summary:hover { footer { margin-top: 5rem; gap: 1rem; - display: flex; + display: grid; + grid-template: auto / auto auto; justify-content: center; } @@ -151,6 +153,7 @@ select:focus { } .btns { - display: flex; + display: grid; + grid-template: auto / auto auto auto; gap: 1rem; } \ No newline at end of file diff --git a/assets/index.html b/assets/index.html index 2a023f0..c052d43 100644 --- a/assets/index.html +++ b/assets/index.html @@ -1,23 +1,25 @@ + soundcloak +

soundcloak

- - - -
+ + + +
@@ -25,8 +27,6 @@ Featured Tracks Preferences -
- Source code Legal notice diff --git a/lib/sc/init.go b/lib/sc/init.go index 2bc26be..bcb574a 100644 --- a/lib/sc/init.go +++ b/lib/sc/init.go @@ -7,6 +7,7 @@ import ( "net/url" "os" "regexp" + "syscall" "time" "github.com/maid-zone/soundcloak/lib/cfg" @@ -124,7 +125,7 @@ func DoWithRetry(httpc *fasthttp.HostClient, req *fasthttp.Request, resp *fastht return nil } - if !os.IsTimeout(err) && err != fasthttp.ErrTimeout && err != fasthttp.ErrConnectionClosed { + if err != fasthttp.ErrTimeout && err != fasthttp.ErrConnectionClosed && !os.IsTimeout(err) && !errors.Is(err, syscall.EPIPE) { // EPIPE is "broken pipe" error return } } diff --git a/templates/track.templ b/templates/track.templ index 638a9d1..bcbe5e5 100644 --- a/templates/track.templ +++ b/templates/track.templ @@ -81,7 +81,8 @@ templ Track(prefs cfg.Preferences, t sc.Track, stream string, displayErr string)
} @UserItem(&t.Author) -
+ //