More fixes
This commit is contained in:
@@ -116,13 +116,17 @@ def search():
|
|||||||
ctx = h.get("_formatted",{}).get("text", h.get("text","")[:300])
|
ctx = h.get("_formatted",{}).get("text", h.get("text","")[:300])
|
||||||
segs = h.get("segments",[])
|
segs = h.get("segments",[])
|
||||||
ts = int(segs[0]["start"]) if segs else 0
|
ts = int(segs[0]["start"]) if segs else 0
|
||||||
open_link = f"/open?file={{requests.utils.quote(src)}}&t={ts}" if typ=='podcast' else f"/open?file={{requests.utils.quote(src)}}"
|
if typ == 'podcast':
|
||||||
|
open_link = f"/open?file={requests.utils.quote(src)}&t={ts}"
|
||||||
|
else:
|
||||||
|
open_link = f"/open?file={requests.utils.quote(src)}"
|
||||||
|
transcript_link = f" | <a href=\"/subtitle?file={requests.utils.quote(src)}\">Transcript</a>" if typ == 'podcast' else ""
|
||||||
badge = f"<span class='badge'>{typ}</span>"
|
badge = f"<span class='badge'>{typ}</span>"
|
||||||
out.append(
|
out.append(
|
||||||
f"<div class='card'><b>{badge}{t}</b><br><small>{src}</small>"
|
f"<div class='card'><b>{badge}{t}</b><br><small>{src}</small>"
|
||||||
f"<p>{ctx}</p>"
|
f"<p>{ctx}</p>"
|
||||||
f"<a href='{open_link}'>Open</a>"
|
f"<a href='{open_link}'>Open</a>"
|
||||||
f"{' | <a href=\"/subtitle?file='+requests.utils.quote(src)+'\">Transcript</a>' if typ=='podcast' else ''}"
|
f"{transcript_link}"
|
||||||
f"</div>"
|
f"</div>"
|
||||||
)
|
)
|
||||||
return "\n".join(out) or "<small>No results yet.</small>"
|
return "\n".join(out) or "<small>No results yet.</small>"
|
||||||
|
|||||||
Reference in New Issue
Block a user