cmds

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Package cmds used for commands modules

Index

Constants

View Source
const (
	SearchActionUsage = "allow to overwrite action in search command"
	IDLookupUsage     = "allow to overwrite id in search lookup"
	IDTypeUsage       = "allow to overwrite id_type in search lookup"
)

Usage strings in module

View Source
const (
	FoundOne = 1
	NotFound = 0
)

runtime consts

Variables

View Source
var (
	AppFs = afero.NewOsFs()
)

Command vars

View Source
var Avflags = map[string]bool{
	"a":                  true,
	"c":                  true,
	"calendars":          true,
	"certifications":     true,
	"checkin":            true,
	"collection":         true,
	"comment":            true,
	"comment_id":         true,
	"comment_type":       true,
	"comments":           true,
	"count_specials":     true,
	"countries":          true,
	"country":            true,
	"days":               true,
	"delete":             true,
	"episode_abs":        true,
	"episode_code":       true,
	"episodes":           true,
	"episode":            true,
	"ex":                 true,
	"f":                  true,
	"field":              true,
	"genres":             true,
	"godoc":              true,
	"help":               true,
	"hidden":             true,
	"hide":               true,
	"history":            true,
	"i":                  true,
	"id_type":            true,
	"ignore_collected":   true,
	"ignore_watchlisted": true,
	"include_replies":    true,
	"item":               true,
	"language":           true,
	"languages":          true,
	"lists":              true,
	"movies":             true,
	"msg":                true,
	"networks":           true,
	"notes":              true,
	"o":                  true,
	"pause":              true,
	"people":             true,
	"period":             true,
	"privacy":            true,
	"progress":           true,
	"q":                  true,
	"recommendations":    true,
	"releases":           true,
	"remove":             true,
	"reply":              true,
	"reset_at":           true,
	"s":                  true,
	"scrobble":           true,
	"search":             true,
	"seasons":            true,
	"season":             true,
	"shows":              true,
	"specials":           true,
	"spoiler":            true,
	"start":              true,
	"start_date":         true,
	"stop":               true,
	"t":                  true,
	"trakt_id":           true,
	"translations":       true,
	"u":                  true,
	"users":              true,
	"undo":               true,
	"v":                  true,
	"version":            true,
	"watchlist":          true,
}

Avflags contains all available flags

View Source
var CalendarsCmd = &Command{
	Name:    "calendars",
	Usage:   "",
	Summary: "By default, the calendar will return all shows or movies for the specified time period and can be global or user specific.",
	Help:    `calendars command`,
}

CalendarsCmd process selected user calendars

View Source
var CertificationsCmd = &Command{
	Name:    "certifications",
	Usage:   "",
	Summary: "Certifications list",
	Help:    `certifications command`,
}

CertificationsCmd create or delete active checkins.

View Source
var CheckinCmd = &Command{
	Name:    "checkin",
	Usage:   "",
	Summary: "Checkin movie,episode,show_episode,delete",
	Help:    `checkin command`,
}

CheckinCmd create or delete active checkins.

View Source
var CollectionCmd = &Command{
	Name:    "collection",
	Usage:   "",
	Summary: "Get all collected items in a user's collection.",
	Help:    `collection command`,
}

CollectionCmd get all collected items in a user's collection.

Commands is list of all commands

View Source
var CommentsCmd = &Command{
	Name:    "comments",
	Usage:   "",
	Summary: "Comments comments,comment,replies,item,likes,like,trending,recent,updates",
	Help:    `comments command`,
}

CommentsCmd manage all types of comments:movie, show, season, episode, or list.

View Source
var CountriesCmd = &Command{
	Name:    "countries",
	Usage:   "",
	Summary: "Get a list of all countries, including names and codes.",
	Help:    `countries command`,
}

CountriesCmd create or delete active checkins.

View Source
var EpisodesCmd = &Command{
	Name:    "episodes",
	Usage:   "",
	Summary: "Returns data about episodes: summary, season, episodes, translations, comments etc...",
	Help:    `episodes command`,
}

EpisodesCmd returns episodes and episodes that a user has watched, sorted by most recent.

View Source
var GenresCmd = &Command{
	Name:    "genres",
	Usage:   "",
	Summary: "Get a list of all genres, including names and slugs.",
	Help:    `genres command`,
}

GenresCmd create or delete active checkins.

View Source
var HelpCmd = &Command{
	Name:    "help",
	Usage:   "[<commands>]",
	Summary: "Help on the trakt-sync command and subcommands.",
}

HelpCmd shows help on the trakt-sync command and subcommands.

View Source
var HistoryCmd = &Command{
	Name:    "history",
	Usage:   "",
	Summary: "Returns movies and episodes that a user has watched, sorted by most recent.",
	Help:    `history command`,
}

HistoryCmd returns movies and episodes that a user has watched, sorted by most recent.

View Source
var LanguagesCmd = &Command{
	Name:    "languages",
	Usage:   "",
	Summary: "Get a list of all languages, including names and codes.",
	Help:    `languages command`,
}

LanguagesCmd create or delete active checkins.

View Source
var ListsCmd = &Command{
	Name:    "lists",
	Usage:   "",
	Summary: "Returns data about lists: trending, popular, list, likes, like, items, comments.",
	Help:    `lists command`,
}

ListsCmd returns movies and episodes that a user has watched, sorted by most recent.

View Source
var MoviesCmd = &Command{
	Name:    "movies",
	Usage:   "",
	Summary: "Returns data about movies: trending, popular, list, likes, like, items, comments etc...",
	Help:    `movies command`,
}

MoviesCmd returns movies and episodes that a user has watched, sorted by most recent.

View Source
var NetworksCmd = &Command{
	Name:    "networks",
	Usage:   "",
	Summary: "Get a list of all TV networks",
	Help:    `networks command`,
}

NetworksCmd returns networks and episodes that a user has watched, sorted by most recent.

View Source
var NotesCmd = &Command{
	Name:    "notes",
	Usage:   "",
	Summary: "Manage notes created by user",
	Help:    `notes command`,
}

NotesCmd manage notes.

View Source
var PeopleCmd = &Command{
	Name:    "people",
	Usage:   "",
	Summary: "Returns all data for selected person.",
	Help:    `people command`,
}

PeopleCmd returns all data for selected person.

View Source
var RecommendationsCmd = &Command{
	Name:    "recommendations",
	Usage:   "",
	Summary: "Recommendations manage movie and shows recommendations for user",
	Help:    `recommendations command`,
}

RecommendationsCmd manage movie and shows recommendations for user.

View Source
var ScrobbleCmd = &Command{
	Name:    "scrobble",
	Usage:   "",
	Summary: "Scrobble for start/pause/stop movie,show,episode",
	Help:    `scrobble command`,
}

ScrobbleCmd start/pause/stop what is user watching.

View Source
var SearchCmd = &Command{
	Name:    "search",
	Usage:   "",
	Summary: "Searches can use queries or ID lookups",
	Help:    `search command: Queries will search text fields like the title and overview. ID lookups are helpful if you have an external ID and want to get the Trakt ID and info. These methods can search for movies, shows, episodes, people, and str.`,
}

SearchCmd can use queries or ID lookups

View Source
var SeasonsCmd = &Command{
	Name:    "seasons",
	Usage:   "",
	Summary: "Returns data about seasons: summary, season, episodes, translations, comments etc...",
	Help:    `seasons command`,
}

SeasonsCmd returns seasons and episodes that a user has watched, sorted by most recent.

View Source
var ShowsCmd = &Command{
	Name:    "shows",
	Usage:   "",
	Summary: "Returns data about shows: trending, popular, list, likes, like, items, comments etc...",
	Help:    `shows command`,
}

ShowsCmd returns movies and episodes that a user has watched, sorted by most recent.

View Source
var UsersCmd = &Command{
	Name:    "users",
	Usage:   "",
	Summary: "Returns all data for a users.",
	Help:    `users command`,
}

UsersCmd Returns all personal lists for a user.

View Source
var WatchlistCmd = &Command{
	Name:    "watchlist",
	Usage:   "",
	Summary: "Returns all items in a user's watchlist filtered by type.",
	Help:    `watchlist command`,
}

WatchlistCmd Returns all items in a user's watchlist filtered by type.

Functions

func HelpFunc

func HelpFunc(_ *Command, args ...string) error

HelpFunc shows help message for command

func ModulesRuntime

func ModulesRuntime(args []string, fs afero.Fs, config *cfg.Config, client *internal.Client)

ModulesRuntime core function for process commands

func UpdateOptionsCommonFlags added in v1.9.0

func UpdateOptionsCommonFlags(c *Command, options *str.Options) *str.Options

UpdateOptionsCommonFlags update options depends on common command flags

func UpdateOptionsWithCommandCheckInFlags added in v1.9.0

func UpdateOptionsWithCommandCheckInFlags(options *str.Options) *str.Options

UpdateOptionsWithCommandCheckInFlags update options depends on checkin command flags

func UpdateOptionsWithCommandCommentsFlags added in v1.9.0

func UpdateOptionsWithCommandCommentsFlags(options *str.Options) *str.Options

UpdateOptionsWithCommandCommentsFlags update options depends on comments command flags

func UpdateOptionsWithCommandListsFlags added in v1.9.0

func UpdateOptionsWithCommandListsFlags(options *str.Options) *str.Options

UpdateOptionsWithCommandListsFlags update options depends on lists command flags

func UpdateOptionsWithCommandMoviesFlags added in v1.9.0

func UpdateOptionsWithCommandMoviesFlags(c *Command, options *str.Options) *str.Options

UpdateOptionsWithCommandMoviesFlags update options depends on movies command flags

func UpdateOptionsWithCommandRecommendationsFlags added in v1.9.0

func UpdateOptionsWithCommandRecommendationsFlags(options *str.Options) *str.Options

UpdateOptionsWithCommandRecommendationsFlags update options depends on recommendations command flags

func UpdateOptionsWithCommandScrobbleFlags added in v1.9.0

func UpdateOptionsWithCommandScrobbleFlags(options *str.Options) *str.Options

UpdateOptionsWithCommandScrobbleFlags update options depends on scrobble command flags

func UpdateOptionsWithCommandShowsFlags added in v1.10.0

func UpdateOptionsWithCommandShowsFlags(c *Command, options *str.Options) *str.Options

UpdateOptionsWithCommandShowsFlags update options depends on shows command flags

Types

type Command

type Command struct {
	Flag    flag.FlagSet
	Run     func(cmd *Command, args ...string) error
	Client  *internal.Client
	Config  *cfg.Config
	Options *str.Options
	Name    string
	Usage   string
	Summary string
	Help    string
	Abbrev  string
	// contains filtered or unexported fields
}

A Command represents a subcommand of trakt-sync.

func (*Command) BadArgs

func (c *Command) BadArgs(errFormat string, args ...any)

BadArgs shows error if command have invalid arguments

func (*Command) Errorf

func (c *Command) Errorf(errFormat string, args ...any)

Errorf prints out a formatted error with the right prefixes.

func (*Command) Exec

func (c *Command) Exec(fs afero.Fs, client *internal.Client, config *cfg.Config, args []string) error

Exec core command function

func (*Command) ExportListProcess

func (c *Command) ExportListProcess(
	data *str.ExportlistItem, options *str.Options,
	findDuplicates []any, exportJSON []str.ExportlistItemJSON,
) ([]any, []str.ExportlistItemJSON, error)

ExportListProcess process list items

func (*Command) Fatalf

func (c *Command) Fatalf(errFormat string, args ...any)

Fatalf is like Errorf except the stack unwinds up to the Exec call before exiting the application with status code 1.

func (*Command) IsImdbEpisode added in v1.0.2

func (*Command) IsImdbEpisode(options *str.Options, data *str.ExportlistItem) bool

IsImdbEpisode check episode imdb format

func (*Command) IsImdbMovie added in v1.0.2

func (*Command) IsImdbMovie(options *str.Options, data *str.ExportlistItem) bool

IsImdbMovie check movie imdb format

func (*Command) IsImdbShow added in v1.0.2

func (*Command) IsImdbShow(options *str.Options, data *str.ExportlistItem) bool

IsImdbShow check show imdb format

func (*Command) IsTmdbEpisode added in v1.0.2

func (*Command) IsTmdbEpisode(options *str.Options, data *str.ExportlistItem) bool

IsTmdbEpisode check episode tmdb format

func (*Command) IsTmdbMovie added in v1.0.2

func (*Command) IsTmdbMovie(options *str.Options, data *str.ExportlistItem) bool

IsTmdbMovie check movie tmdb format

func (*Command) IsTmdbShow added in v1.0.2

func (*Command) IsTmdbShow(options *str.Options, data *str.ExportlistItem) bool

IsTmdbShow check show tmdb format

func (*Command) IsTvdbEpisode added in v1.0.2

func (*Command) IsTvdbEpisode(options *str.Options, data *str.ExportlistItem) bool

IsTvdbEpisode check episode tvdb format

func (*Command) PrepareQueryString

func (*Command) PrepareQueryString(q string) *string

PrepareQueryString for remove or replace unwanted signs from query string

func (*Command) UpdateEpisodeFlagsValues added in v1.13.0

func (*Command) UpdateEpisodeFlagsValues()

UpdateEpisodeFlagsValues update episode flags values only in command

func (*Command) UpdateMovieFlagsValues added in v1.8.0

func (*Command) UpdateMovieFlagsValues()

UpdateMovieFlagsValues update movies flags values only in command

func (*Command) UpdateOptionsWithCommandFlags

func (c *Command) UpdateOptionsWithCommandFlags(options *str.Options) *str.Options

UpdateOptionsWithCommandFlags update options depends on command flags

func (*Command) UpdateSeasonFlagsValues added in v1.12.0

func (*Command) UpdateSeasonFlagsValues()

UpdateSeasonFlagsValues update season flags values only in command

func (*Command) UpdateShowFlagsValues added in v1.10.0

func (*Command) UpdateShowFlagsValues()

UpdateShowFlagsValues update show flags values only in command

func (*Command) ValidFlags

func (*Command) ValidFlags() bool

ValidFlags validate if flag is in our list

func (*Command) ValidModuleActionType added in v1.9.0

func (*Command) ValidModuleActionType(options *str.Options) error

ValidModuleActionType check if type is valid

func (*Command) ValidModuleType added in v1.9.0

func (*Command) ValidModuleType(options *str.Options) error

ValidModuleType check if type is valid

func (*Command) ValidPeriod added in v1.8.0

func (*Command) ValidPeriod(options *str.Options) error

ValidPeriod check if period is valid

func (*Command) ValidPeriodForModule added in v1.8.0

func (c *Command) ValidPeriodForModule(options *str.Options) error

ValidPeriodForModule valid period options depends on action value

func (*Command) ValidSort added in v1.8.0

func (*Command) ValidSort(options *str.Options) error

ValidSort check if sort is valid

Jump to

Keyboard shortcuts

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