utils

package
v2.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2022 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllLocales = []crunchyroll.LOCALE{
	crunchyroll.JP,
	crunchyroll.US,
	crunchyroll.LA,
	crunchyroll.ES,
	crunchyroll.FR,
	crunchyroll.PT,
	crunchyroll.BR,
	crunchyroll.IT,
	crunchyroll.DE,
	crunchyroll.RU,
	crunchyroll.AR,
}

AllLocales is an array of all available locales.

Functions

func LocaleLanguage

func LocaleLanguage(locale crunchyroll.LOCALE) string

LocaleLanguage returns the country by its locale.

func SortEpisodesByAudio

func SortEpisodesByAudio(episodes []*crunchyroll.Episode) (map[crunchyroll.LOCALE][]*crunchyroll.Episode, error)

SortEpisodesByAudio sort the given episodes by their audio locale.

func SortEpisodesBySeason

func SortEpisodesBySeason(episodes []*crunchyroll.Episode) [][]*crunchyroll.Episode

SortEpisodesBySeason sorts the given episodes by their seasons. Note that the same episodes just with different audio locales will cause problems.

func ValidateLocale

func ValidateLocale(locale crunchyroll.LOCALE) bool

ValidateLocale validates if the given locale actually exist.

Types

type EpisodesByDuration

type EpisodesByDuration []*crunchyroll.Episode

EpisodesByDuration sorts episodes by their duration.

func (EpisodesByDuration) Len

func (ebd EpisodesByDuration) Len() int

func (EpisodesByDuration) Less

func (ebd EpisodesByDuration) Less(i, j int) bool

func (EpisodesByDuration) Swap

func (ebd EpisodesByDuration) Swap(i, j int)

type EpisodesByNumber

type EpisodesByNumber []*crunchyroll.Episode

EpisodesByNumber sorts episodes after their episode number.

func (EpisodesByNumber) Len

func (ebn EpisodesByNumber) Len() int

func (EpisodesByNumber) Less

func (ebn EpisodesByNumber) Less(i, j int) bool

func (EpisodesByNumber) Swap

func (ebn EpisodesByNumber) Swap(i, j int)

type FormatsByResolution

type FormatsByResolution []*crunchyroll.Format

FormatsByResolution sorts formats after their resolution.

func (FormatsByResolution) Len

func (fbr FormatsByResolution) Len() int

func (FormatsByResolution) Less

func (fbr FormatsByResolution) Less(i, j int) bool

func (FormatsByResolution) Swap

func (fbr FormatsByResolution) Swap(i, j int)

type MovieListingsByDuration

type MovieListingsByDuration []*crunchyroll.MovieListing

MovieListingsByDuration sorts movie listings by their duration.

func (MovieListingsByDuration) Len

func (mlbd MovieListingsByDuration) Len() int

func (MovieListingsByDuration) Less

func (mlbd MovieListingsByDuration) Less(i, j int) bool

func (MovieListingsByDuration) Swap

func (mlbd MovieListingsByDuration) Swap(i, j int)

type SubtitlesByLocale

type SubtitlesByLocale []*crunchyroll.Subtitle

SubtitlesByLocale sorts subtitles after their locale.

func (SubtitlesByLocale) Len

func (sbl SubtitlesByLocale) Len() int

func (SubtitlesByLocale) Less

func (sbl SubtitlesByLocale) Less(i, j int) bool

func (SubtitlesByLocale) Swap

func (sbl SubtitlesByLocale) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL