fix: trim large album names on search page

This commit is contained in:
rramiachraf 2024-06-10 12:38:32 +01:00
parent 355b721069
commit c86b076188

View File

@ -18,13 +18,10 @@ templ SearchPage(r data.SearchResults) {
<h2>Songs</h2> <h2>Songs</h2>
for _, s := range s.Hits { for _, s := range s.Hits {
<a id="search-item" href={ templ.URL(s.Result.Path) }> <a id="search-item" href={ templ.URL(s.Result.Path) }>
<img <img src={ data.ExtractImageURL(s.Result.Thumbnail) } alt="Song image"/>
src={ data.ExtractImageURL(s.Result.Thumbnail) }
alt="Song image"
/>
<div> <div>
<span>{ s.Result.ArtistNames }</span> <span>{ s.Result.ArtistNames }</span>
<h3>{ s.Result.Title }</h3> <h3>{ utils.TrimText(s.Result.Title,70) }</h3>
</div> </div>
</a> </a>
} }
@ -35,12 +32,9 @@ templ SearchPage(r data.SearchResults) {
<h2>Albums</h2> <h2>Albums</h2>
for _, a := range s.Hits { for _, a := range s.Hits {
<a id="search-item" href={ templ.URL(utils.TrimURL(a.Result.URL)) }> <a id="search-item" href={ templ.URL(utils.TrimURL(a.Result.URL)) }>
<img <img src={ data.ExtractImageURL(a.Result.AlbumImage) } alt="Album image"/>
src={ data.ExtractImageURL(a.Result.AlbumImage) }
alt="Album image"
/>
<div> <div>
<h3>{ a.Result.AlbumName }</h3> <h3>{ utils.TrimText(a.Result.AlbumName, 70) }</h3>
</div> </div>
</a> </a>
} }
@ -51,12 +45,9 @@ templ SearchPage(r data.SearchResults) {
<h2>Artists</h2> <h2>Artists</h2>
for _, a := range s.Hits { for _, a := range s.Hits {
<a id="search-item" href={ templ.URL(utils.TrimURL(a.Result.URL)) }> <a id="search-item" href={ templ.URL(utils.TrimURL(a.Result.URL)) }>
<img <img src={ data.ExtractImageURL(a.Result.ArtistImage) } alt="Artist image"/>
src={ data.ExtractImageURL(a.Result.ArtistImage) }
alt="Artist image"
/>
<div> <div>
<h3>{ a.Result.ArtistName }</h3> <h3>{ utils.TrimText(a.Result.ArtistName, 70) }</h3>
</div> </div>
</a> </a>
} }