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

View file

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