diff --git a/main.go b/main.go index 5427a0d..77a6564 100644 --- a/main.go +++ b/main.go @@ -174,6 +174,11 @@ func main() { return c.Redirect().To("/_/static/favicon.ico") }) + app.Get("robots.txt", func(c fiber.Ctx) error { + return c.SendString(`User-agent: * +Disallow: /`) + }) + app.Get("/search", func(c fiber.Ctx) error { prefs, err := preferences.Get(c) if err != nil { diff --git a/static/assets/global.css b/static/assets/global.css index f7fcaaf..99223bf 100644 --- a/static/assets/global.css +++ b/static/assets/global.css @@ -163,4 +163,8 @@ select:focus { .link:hover { text-decoration: underline; +} + +.listing > .comment > h3 { + margin: 0; } \ No newline at end of file diff --git a/static/assets/robots.txt b/static/assets/robots.txt deleted file mode 100644 index 77470cb..0000000 --- a/static/assets/robots.txt +++ /dev/null @@ -1,2 +0,0 @@ -User-agent: * -Disallow: / \ No newline at end of file diff --git a/templates/featured.templ b/templates/featured.templ index 5d53dd6..ed4627d 100644 --- a/templates/featured.templ +++ b/templates/featured.templ @@ -16,7 +16,7 @@ templ FeaturedTracks(p *sc.Paginated[*sc.Track]) { @TrackItem(track, true, "") } if p.Next != "" { - more tracks + more tracks } } } diff --git a/templates/playlist.templ b/templates/playlist.templ index cafadd7..746d2de 100644 --- a/templates/playlist.templ +++ b/templates/playlist.templ @@ -21,7 +21,7 @@ func playlist(t sc.Track, p sc.Playlist) string { } templ PlaylistItem(playlist *sc.Playlist, showUsername bool) { - + if playlist.Artwork != "" { } else { @@ -44,7 +44,7 @@ templ Playlist(prefs cfg.Preferences, p sc.Playlist) {

{ p.Title }

@UserItem(&p.Author)
- view on soundcloud + view on soundcloud

@Description(prefs, p.Description, nil) @@ -61,7 +61,7 @@ templ Playlist(prefs cfg.Preferences, p sc.Playlist) { } if len(p.MissingTracks) != 0 { - more tracks + more tracks }
if p.TagList != "" { @@ -91,7 +91,7 @@ templ SearchPlaylists(p *sc.Paginated[*sc.Playlist]) { @PlaylistItem(playlist, true) } if p.Next != "" && len(p.Collection) != int(p.Total) { - more playlists + more playlists } } } diff --git a/templates/tags.templ b/templates/tags.templ index 37f1829..e0b5873 100644 --- a/templates/tags.templ +++ b/templates/tags.templ @@ -13,7 +13,7 @@ templ TagsButtons(current string, tag string) { if b.text == current { { b.text } } else { - { b.text } + { b.text } } }
@@ -30,7 +30,7 @@ templ RecentTracks(tag string, p *sc.Paginated[*sc.Track]) { @TrackItem(track, true, "") } if p.Next != "" { - more tracks + more tracks } } } @@ -48,7 +48,7 @@ templ PopularTracks(tag string, p *sc.Paginated[*sc.Track]) { @TrackItem(track, true, "") } if p.Next != "" { - more tracks + more tracks } } } @@ -68,7 +68,7 @@ templ TaggedPlaylists(tag string, p *sc.Paginated[*sc.Playlist]) { @PlaylistItem(playlist, true) } if p.Next != "" && len(p.Collection) != int(p.Total) { - more playlists + more playlists } } } diff --git a/templates/track.templ b/templates/track.templ index 29943a3..90890e1 100644 --- a/templates/track.templ +++ b/templates/track.templ @@ -28,12 +28,12 @@ templ TrackButtons(current string, track sc.Track) { { b.text } } else { if b.external { - { b.text } + { b.text } } else { if b.override { - { b.text } + { b.text } } else { - { b.text } + { b.text } } } } @@ -129,7 +129,7 @@ templ TrackItem(track *sc.Track, showUsername bool, overrideHref string) { overrideHref = track.Href() } }} - + if track.Artwork != "" { } else { @@ -153,11 +153,11 @@ templ Track(prefs cfg.Preferences, t sc.Track, stream string, displayErr string, @TrackPlayer(prefs, t, stream, displayErr, autoplay, nextTrack, playlist, volume, mode, audio) if cfg.Restream {
- download + download
} if t.Genre != "" { -

{ t.Genre }

+

{ t.Genre }

} if playlist != nil {
@@ -167,11 +167,11 @@ templ Track(prefs cfg.Preferences, t sc.Track, stream string, displayErr string,

Next track:

@TrackItem(nextTrack, true, next(nextTrack, playlist, true, mode, volume))
- Stop playlist playback + Stop playlist playback if mode != cfg.AutoplayRandom { - Switch to random mode + Switch to random mode } else { - Switch to normal mode + Switch to normal mode }
@@ -179,9 +179,9 @@ templ Track(prefs cfg.Preferences, t sc.Track, stream string, displayErr string, @UserItem(&t.Author) @TrackButtons("", t) //
- // view on soundcloud + // view on soundcloud // if cfg.Restream { - // download + // download // } //

@@ -197,17 +197,26 @@ templ Track(prefs cfg.Preferences, t sc.Track, stream string, displayErr string, if t.TagList != "" {

Tags: { strings.Join(sc.TagListParser(t.TagList), ", ") }

} -

Comments

-
if comments != nil { - for _, c := range comments.Collection { -
-

{c.Author.Username}

-

{c.Body}

-
- } +

Comments

+
+ for _, c := range comments.Collection { +
+ if c.Author.Avatar != "" { + + } else { + + } +
+ +

{ c.Body }

+
+
+ } +
+ } else { + load comments } -
} templ TrackEmbed(prefs cfg.Preferences, t sc.Track, stream string, displayErr string) { @@ -218,7 +227,7 @@ templ TrackEmbed(prefs cfg.Preferences, t sc.Track, stream string, displayErr st soundcloak - if *prefs.Player == cfg.HLSPlayer { + if *prefs.Player == cfg.HLSPlayer && stream != "" { } @@ -244,7 +253,7 @@ templ SearchTracks(p *sc.Paginated[*sc.Track]) { @TrackItem(track, true, "") } if p.Next != "" && len(p.Collection) != int(p.Total) { - more tracks + more tracks } } } @@ -253,7 +262,7 @@ templ RelatedTracks(t sc.Track, p *sc.Paginated[*sc.Track]) { if t.Artwork != "" { } -

{ t.Title }

+

{ t.Title }

@TrackButtons("related tracks", t)
if len(p.Collection) == 0 { @@ -263,7 +272,7 @@ templ RelatedTracks(t sc.Track, p *sc.Paginated[*sc.Track]) { @TrackItem(track, true, "") } if p.Next != "" { - more tracks + more tracks } } } @@ -272,7 +281,7 @@ templ TrackInAlbums(t sc.Track, p *sc.Paginated[*sc.Playlist]) { if t.Artwork != "" { } -

{ t.Title }

+

{ t.Title }

@TrackButtons("in albums", t)
if len(p.Collection) == 0 { @@ -282,7 +291,7 @@ templ TrackInAlbums(t sc.Track, p *sc.Paginated[*sc.Playlist]) { @PlaylistItem(playlist, true) } if p.Next != "" { - more albums + more albums } } } @@ -291,7 +300,7 @@ templ TrackInPlaylists(t sc.Track, p *sc.Paginated[*sc.Playlist]) { if t.Artwork != "" { } -

{ t.Title }

+

{ t.Title }

@TrackButtons("in playlists", t)
if len(p.Collection) == 0 { @@ -301,7 +310,7 @@ templ TrackInPlaylists(t sc.Track, p *sc.Paginated[*sc.Playlist]) { @PlaylistItem(playlist, true) } if p.Next != "" { - more playlists + more playlists } } } diff --git a/templates/user.templ b/templates/user.templ index 20568df..7971f29 100644 --- a/templates/user.templ +++ b/templates/user.templ @@ -17,7 +17,7 @@ templ UserHeader(u sc.User) { } templ UserItem(user *sc.User) { - + if user.Avatar != "" { } else { @@ -36,7 +36,7 @@ templ UserLinks(links []sc.Link) { for _, link := range links { if len(link.URL) > 0 { if link.URL[0] == '/' { -

- { link.Title }

+

- { link.Title }

} else {

- { link.Title }

} @@ -63,9 +63,9 @@ templ UserBase(prefs cfg.Preferences, u sc.User) { @Description(prefs, u.Description, nil) }
-

{ strconv.FormatInt(u.Followers, 10) } followers

-

{ strconv.FormatInt(u.Following, 10) } followings

-

{ strconv.FormatInt(u.Liked, 10) } liked

+

{ strconv.FormatInt(u.Followers, 10) } followers

+

{ strconv.FormatInt(u.Following, 10) } followings

+

{ strconv.FormatInt(u.Liked, 10) } liked

{ strconv.FormatInt(u.Tracks, 10) } tracks

{ strconv.FormatInt(u.Playlists, 10) } playlists & albums


@@ -89,12 +89,12 @@ templ UserButtons(current string, user sc.User) { { b.text } } else { if b.external { - { b.text } + { b.text } } else { if b.override { - { b.text } + { b.text } } else { - { b.text } + { b.text } } } } @@ -115,7 +115,7 @@ templ User(prefs cfg.Preferences, u sc.User, p *sc.Paginated[*sc.Track]) { }
if p.Next != "" && len(p.Collection) != int(u.Tracks) { - more tracks + more tracks } } else { no more tracks @@ -133,7 +133,7 @@ templ UserPlaylists(prefs cfg.Preferences, u sc.User, p *sc.Paginated[*sc.Playli } if p.Next != "" && len(p.Collection) != int(p.Total) { - more playlists + more playlists } } else { no more playlists @@ -151,7 +151,7 @@ templ UserAlbums(prefs cfg.Preferences, u sc.User, p *sc.Paginated[*sc.Playlist] } if p.Next != "" && len(p.Collection) != int(p.Total) { - more albums + more albums } } else { no more albums @@ -173,7 +173,7 @@ templ UserReposts(prefs cfg.Preferences, u sc.User, p *sc.Paginated[*sc.Repost]) } if p.Next != "" && len(p.Collection) != int(p.Total) { - more reposts + more reposts } } else { no more reposts @@ -195,7 +195,7 @@ templ UserLikes(prefs cfg.Preferences, u sc.User, p *sc.Paginated[*sc.Like]) { } if p.Next != "" && len(p.Collection) != int(p.Total) { - more likes + more likes } } else { no more likes @@ -243,7 +243,7 @@ templ UserFollowers(prefs cfg.Preferences, u sc.User, p *sc.Paginated[*sc.User]) } if p.Next != "" && len(p.Collection) != int(p.Total) { - more users + more users } } else { no more users @@ -261,7 +261,7 @@ templ UserFollowing(prefs cfg.Preferences, u sc.User, p *sc.Paginated[*sc.User]) } if p.Next != "" && len(p.Collection) != int(p.Total) { - more users + more users } } else { no more users @@ -281,7 +281,7 @@ templ SearchUsers(p *sc.Paginated[*sc.User]) { @UserItem(user) } if p.Next != "" && len(p.Collection) != int(p.Total) { - more users + more users } } }