Change const names to make them more readable

This commit is contained in:
bytedream 2022-06-21 17:43:12 +02:00
parent 256c97c2b7
commit d1859b4c25
2 changed files with 15 additions and 15 deletions

View file

@ -34,32 +34,32 @@ const (
type MediaType string type MediaType string
const ( const (
SERIES MediaType = "series" MediaTypeSeries MediaType = "series"
MOVIELISTING = "movie_listing" MediaTypeMovie = "movie_listing"
) )
// BrowseSortType represents a sort type to sort Crunchyroll.Browse items after. // BrowseSortType represents a sort type to sort Crunchyroll.Browse items after.
type BrowseSortType string type BrowseSortType string
const ( const (
BROWSESORTPOPULARITY BrowseSortType = "popularity" BrowseSortPopularity BrowseSortType = "popularity"
BROWSESORTNEWLYADDED = "newly_added" BrowseSortNewlyAdded = "newly_added"
BROWSESORTALPHABETICAL = "alphabetical" BrowseSortAlphabetical = "alphabetical"
) )
// WatchlistLanguageType represents a filter type to filter Crunchyroll.WatchList entries after. // WatchlistLanguageType represents a filter type to filter Crunchyroll.WatchList entries after.
type WatchlistLanguageType int type WatchlistLanguageType int
const ( const (
WATCHLISTLANGUAGESUBBED WatchlistLanguageType = iota + 1 WatchlistLanguageSubbed WatchlistLanguageType = iota + 1
WATCHLISTLANGUAGEDUBBED WatchlistLanguageDubbed
) )
type WatchlistContentType string type WatchlistContentType string
const ( const (
WATCHLISTCONTENTSERIES WatchlistContentType = "series" WatchlistContentSeries WatchlistContentType = "series"
WATCHLISTCONTENTMOVIES = "movie_listing" WatchlistContentMovies = "movie_listing"
) )
type Crunchyroll struct { type Crunchyroll struct {
@ -869,9 +869,9 @@ func (c *Crunchyroll) Watchlist(options WatchlistOptions, limit uint) ([]*Watchl
values.Set("only_favorites", "true") values.Set("only_favorites", "true")
} }
switch options.LanguageType { switch options.LanguageType {
case WATCHLISTLANGUAGESUBBED: case WatchlistLanguageSubbed:
values.Set("is_subbed", "true") values.Set("is_subbed", "true")
case WATCHLISTLANGUAGEDUBBED: case WatchlistLanguageDubbed:
values.Set("is_dubbed", "true") values.Set("is_dubbed", "true")
} }
values.Set("n", strconv.Itoa(int(limit))) values.Set("n", strconv.Itoa(int(limit)))
@ -894,9 +894,9 @@ func (c *Crunchyroll) Watchlist(options WatchlistOptions, limit uint) ([]*Watchl
for _, entry := range watchlistEntries { for _, entry := range watchlistEntries {
switch entry.Panel.Type { switch entry.Panel.Type {
case WATCHLISTENTRYEPISODE: case WatchlistEntryEpisode:
entry.Panel.EpisodeMetadata.crunchy = c entry.Panel.EpisodeMetadata.crunchy = c
case WATCHLISTENTRYSERIES: case WatchlistEntrySeries:
entry.Panel.SeriesMetadata.crunchy = c entry.Panel.SeriesMetadata.crunchy = c
} }
} }

View file

@ -91,8 +91,8 @@ type HistoryEpisode struct {
type WatchlistEntryType string type WatchlistEntryType string
const ( const (
WATCHLISTENTRYEPISODE = "episode" WatchlistEntryEpisode = "episode"
WATCHLISTENTRYSERIES = "series" WatchlistEntrySeries = "series"
) )
// EpisodeFromID returns an episode by its api id. // EpisodeFromID returns an episode by its api id.