make artist and album hyperlinks in tracklist; refactor navigation to the controller package

This commit is contained in:
Drew Weymouth
2023-02-23 17:23:14 -08:00
parent 6682e3923e
commit d01ac697bd
16 changed files with 218 additions and 195 deletions
+63
View File
@@ -0,0 +1,63 @@
package controller
import "supersonic/backend"
type PageName int
const (
Blank PageName = iota
Album
Albums
Artist
Artists
Genre
Genres
Favorites
NowPlaying
Playlist
Playlists
)
type Route struct {
Page PageName
Arg string
}
func AlbumsRoute(sortOrder backend.AlbumSortOrder) Route {
return Route{Page: Albums, Arg: string(sortOrder)}
}
func ArtistRoute(artistID string) Route {
return Route{Page: Artist, Arg: artistID}
}
func AlbumRoute(albumID string) Route {
return Route{Page: Album, Arg: albumID}
}
func FavoritesRoute() Route {
return Route{Page: Favorites}
}
func GenreRoute(genre string) Route {
return Route{Page: Genre, Arg: genre}
}
func GenresRoute() Route {
return Route{Page: Genres}
}
func PlaylistRoute(id string) Route {
return Route{Page: Playlist, Arg: id}
}
func PlaylistsRoute() Route {
return Route{Page: Playlists}
}
func ArtistsRoute() Route {
return Route{Page: Artists}
}
func NowPlayingRoute() Route {
return Route{Page: NowPlaying}
}