mirror of
https://git.maid.zone/stuff/soundcloak.git
synced 2025-12-10 13:49:39 +05:00
change buttons layout (so it looks ok on mobile) and catch "broken pipe" in sc.DoWithRetry
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -1,23 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>soundcloak</title>
|
||||
<link rel="stylesheet" href="global.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1 id="sc">soundcloak</h1>
|
||||
<form action="/search">
|
||||
<div style="display: flex; gap: .5rem;">
|
||||
<input name="q" type="text" style="padding: .5rem .6rem; flex-grow: 1;">
|
||||
<input name="q" type="text" style="padding: .5rem .6rem; flex-grow: 1;">
|
||||
|
||||
<select name="type">
|
||||
<option value="tracks">Tracks</option>
|
||||
<option value="users">Users</option>
|
||||
<option value="playlists">Playlists</option>
|
||||
</select>
|
||||
</div>
|
||||
<select name="type">
|
||||
<option value="tracks">Tracks</option>
|
||||
<option value="users">Users</option>
|
||||
<option value="playlists">Playlists</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<input type="submit" value="Search" class="btn" style="width: 100%; margin-top: .5rem;">
|
||||
</form>
|
||||
@@ -25,8 +27,6 @@
|
||||
<a class="btn" href="/_/featured">Featured Tracks</a>
|
||||
<a class="btn" href="/_/preferences">Preferences</a>
|
||||
|
||||
<br>
|
||||
|
||||
<a class="btn" href="https://github.com/maid-zone/soundcloak">Source code</a>
|
||||
<a class="btn" href="/notice.txt">Legal notice</a>
|
||||
</footer>
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,8 @@ templ Track(prefs cfg.Preferences, t sc.Track, stream string, displayErr string)
|
||||
<br/>
|
||||
}
|
||||
@UserItem(&t.Author)
|
||||
<div class="btns">
|
||||
//<div class="btns">
|
||||
<div style="display: flex;">
|
||||
<a class="btn" href={ templ.URL("https://soundcloud.com/" + t.Author.Permalink + "/" + t.Permalink) }>view on soundcloud</a>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
Reference in New Issue
Block a user