From d1859b4c25c3f7f627b50f03f0f5202da681144a Mon Sep 17 00:00:00 2001 From: bytedream Date: Tue, 21 Jun 2022 17:43:12 +0200 Subject: [PATCH] Change const names to make them more readable --- crunchyroll.go | 26 +++++++++++++------------- episode.go | 4 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/crunchyroll.go b/crunchyroll.go index 704003d..5de3ab2 100644 --- a/crunchyroll.go +++ b/crunchyroll.go @@ -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 } } diff --git a/episode.go b/episode.go index 9e20510..b02280d 100644 --- a/episode.go +++ b/episode.go @@ -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.