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
- Variables
- func HelpFunc(_ *Command, args ...string) error
- func ModulesRuntime(args []string, fs afero.Fs, config *cfg.Config, client *internal.Client)
- func UpdateOptionsCommonFlags(c *Command, options *str.Options) *str.Options
- func UpdateOptionsWithCommandCheckInFlags(options *str.Options) *str.Options
- func UpdateOptionsWithCommandCommentsFlags(options *str.Options) *str.Options
- func UpdateOptionsWithCommandListsFlags(options *str.Options) *str.Options
- func UpdateOptionsWithCommandMoviesFlags(c *Command, options *str.Options) *str.Options
- func UpdateOptionsWithCommandRecommendationsFlags(options *str.Options) *str.Options
- func UpdateOptionsWithCommandScrobbleFlags(options *str.Options) *str.Options
- func UpdateOptionsWithCommandShowsFlags(c *Command, options *str.Options) *str.Options
- type Command
- func (c *Command) BadArgs(errFormat string, args ...any)
- func (c *Command) Errorf(errFormat string, args ...any)
- func (c *Command) Exec(fs afero.Fs, client *internal.Client, config *cfg.Config, args []string) error
- func (c *Command) ExportListProcess(data *str.ExportlistItem, options *str.Options, findDuplicates []any, ...) ([]any, []str.ExportlistItemJSON, error)
- func (c *Command) Fatalf(errFormat string, args ...any)
- func (*Command) IsImdbEpisode(options *str.Options, data *str.ExportlistItem) bool
- func (*Command) IsImdbMovie(options *str.Options, data *str.ExportlistItem) bool
- func (*Command) IsImdbShow(options *str.Options, data *str.ExportlistItem) bool
- func (*Command) IsTmdbEpisode(options *str.Options, data *str.ExportlistItem) bool
- func (*Command) IsTmdbMovie(options *str.Options, data *str.ExportlistItem) bool
- func (*Command) IsTmdbShow(options *str.Options, data *str.ExportlistItem) bool
- func (*Command) IsTvdbEpisode(options *str.Options, data *str.ExportlistItem) bool
- func (*Command) PrepareQueryString(q string) *string
- func (*Command) UpdateEpisodeFlagsValues()
- func (*Command) UpdateMovieFlagsValues()
- func (c *Command) UpdateOptionsWithCommandFlags(options *str.Options) *str.Options
- func (*Command) UpdateSeasonFlagsValues()
- func (*Command) UpdateShowFlagsValues()
- func (*Command) ValidFlags() bool
- func (*Command) ValidModuleActionType(options *str.Options) error
- func (*Command) ValidModuleType(options *str.Options) error
- func (*Command) ValidPeriod(options *str.Options) error
- func (c *Command) ValidPeriodForModule(options *str.Options) error
- func (*Command) ValidSort(options *str.Options) error
Constants ¶
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
const ( FoundOne = 1 NotFound = 0 )
runtime consts
Variables ¶
var (
AppFs = afero.NewOsFs()
)
Command vars
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
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
var CertificationsCmd = &Command{
Name: "certifications",
Usage: "",
Summary: "Certifications list",
Help: `certifications command`,
}
CertificationsCmd create or delete active checkins.
var CheckinCmd = &Command{
Name: "checkin",
Usage: "",
Summary: "Checkin movie,episode,show_episode,delete",
Help: `checkin command`,
}
CheckinCmd create or delete active checkins.
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.
var Commands = []*Command{ CalendarsCmd, CertificationsCmd, CheckinCmd, CommentsCmd, CollectionCmd, CountriesCmd, EpisodesCmd, GenresCmd, HelpCmd, HistoryCmd, LanguagesCmd, ListsCmd, MoviesCmd, NetworksCmd, NotesCmd, PeopleCmd, RecommendationsCmd, ScrobbleCmd, SearchCmd, SeasonsCmd, ShowsCmd, UsersCmd, WatchlistCmd, }
Commands is list of all commands
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
var NotesCmd = &Command{
Name: "notes",
Usage: "",
Summary: "Manage notes created by user",
Help: `notes command`,
}
NotesCmd manage notes.
var PeopleCmd = &Command{
Name: "people",
Usage: "",
Summary: "Returns all data for selected person.",
Help: `people command`,
}
PeopleCmd returns all data for selected person.
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.
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.
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
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.
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.
var UsersCmd = &Command{
Name: "users",
Usage: "",
Summary: "Returns all data for a users.",
Help: `users command`,
}
UsersCmd Returns all personal lists for a user.
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 ModulesRuntime ¶
ModulesRuntime core function for process commands
func UpdateOptionsCommonFlags ¶ added in v1.9.0
UpdateOptionsCommonFlags update options depends on common command flags
func UpdateOptionsWithCommandCheckInFlags ¶ added in v1.9.0
UpdateOptionsWithCommandCheckInFlags update options depends on checkin command flags
func UpdateOptionsWithCommandCommentsFlags ¶ added in v1.9.0
UpdateOptionsWithCommandCommentsFlags update options depends on comments command flags
func UpdateOptionsWithCommandListsFlags ¶ added in v1.9.0
UpdateOptionsWithCommandListsFlags update options depends on lists command flags
func UpdateOptionsWithCommandMoviesFlags ¶ added in v1.9.0
UpdateOptionsWithCommandMoviesFlags update options depends on movies command flags
func UpdateOptionsWithCommandRecommendationsFlags ¶ added in v1.9.0
UpdateOptionsWithCommandRecommendationsFlags update options depends on recommendations command flags
func UpdateOptionsWithCommandScrobbleFlags ¶ added in v1.9.0
UpdateOptionsWithCommandScrobbleFlags update options depends on scrobble 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) 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 ¶
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
IsImdbEpisode check episode imdb format
func (*Command) IsImdbMovie ¶ added in v1.0.2
IsImdbMovie check movie imdb format
func (*Command) IsImdbShow ¶ added in v1.0.2
IsImdbShow check show imdb format
func (*Command) IsTmdbEpisode ¶ added in v1.0.2
IsTmdbEpisode check episode tmdb format
func (*Command) IsTmdbMovie ¶ added in v1.0.2
IsTmdbMovie check movie tmdb format
func (*Command) IsTmdbShow ¶ added in v1.0.2
IsTmdbShow check show tmdb format
func (*Command) IsTvdbEpisode ¶ added in v1.0.2
IsTvdbEpisode check episode tvdb format
func (*Command) PrepareQueryString ¶
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 ¶
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 ¶
ValidFlags validate if flag is in our list
func (*Command) ValidModuleActionType ¶ added in v1.9.0
ValidModuleActionType check if type is valid
func (*Command) ValidModuleType ¶ added in v1.9.0
ValidModuleType check if type is valid
func (*Command) ValidPeriod ¶ added in v1.8.0
ValidPeriod check if period is valid
func (*Command) ValidPeriodForModule ¶ added in v1.8.0
ValidPeriodForModule valid period options depends on action value
Source Files
¶
- command.go
- command_calendars.go
- command_certifications.go
- command_checkin.go
- command_collection.go
- command_comments.go
- command_countries.go
- command_episodes.go
- command_genres.go
- command_help.go
- command_history.go
- command_languages.go
- command_lists.go
- command_movies.go
- command_networks.go
- command_notes.go
- command_people.go
- command_recommendations.go
- command_scrobble.go
- command_search.go
- command_seasons.go
- command_shows.go
- command_users.go
- command_watchlist.go
- runtime.go