unserializd

package module
v0.0.0-...-22fe98d Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 6 Imported by: 0

README

unserializd header image

unserializd

An unofficial Go package for accessing the Serializd API

Status: Work in Progress

Getting Started

Installing

Use go get to retrieve the package to add it to your project's Go module dependencies.

go get github.com/skyth3r/unserializd

To update the package use go get -u to retrieve the latest version of the package.

go get -u github.com/skyth3r/unserializd

Docs

🔜

Quick Examples

// Create new client
client := unserializd.NewClient()

// Get user's diary
diary, err := client.Diary("USERNAME")
if err != nil {
    fmt.Println(err)
}
fmt.Println(diary)

// Get user's watched TV Shows
watched, err := client.Watched("USERNAME", 0)
if err != nil {
    fmt.Println(err)
}
fmt.Println(watched)

// Get TV shows on user's watchlist
watchlist, err := client.Watchlist("USERNAME", 0)
if err != nil {
    fmt.Println(err)
}
fmt.Println(watchlist.NumberOfShows)
for _, item := range watchlist.WatchlistItems {
    fmt.Println(item.ShowName)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient() *Client

func (*Client) CreatedLists

func (c *Client) CreatedLists(username string, s ListSortingOption) (*CreatedLists, error)

func (*Client) Diary

func (c *Client) Diary(username string) (*SerializdDiary, error)

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

func (*Client) Dropped

func (c *Client) Dropped(username string, s SortingOption) (*Dropped, error)

func (*Client) Following

func (c *Client) Following(username string) (*Following, error)

func (*Client) Paused

func (c *Client) Paused(username string, s SortingOption) (*Paused, error)

func (*Client) PinnedReviews

func (c *Client) PinnedReviews(username string) (*PinnedReviews, error)

func (*Client) Reviews

func (c *Client) Reviews(username string, s ReviewSortingOption, includeRatings bool, rating int) (*Reviews, error)

func (*Client) Tags

func (c *Client) Tags(username string) (*Tags, error)

func (*Client) Watched

func (c *Client) Watched(username string, s SortingOption) (*Watched, error)

func (*Client) Watching

func (c *Client) Watching(username string, s SortingOption) (*CurrentlyWatching, error)

func (*Client) Watchlist

func (c *Client) Watchlist(username string, s SortingOption) (*Watchlist, error)

type CreatedList

type CreatedList struct {
	ListID          int    `json:"listId"`
	ListName        string `json:"listName"`
	ListDescription string `json:"listDescription"`
	IsPrivate       bool   `json:"isPrivate"`
	IsRanked        bool   `json:"isRanked"`
	//ListCollaboratorIDs  []string     `json:"listCollaboratorIds"`
	LastEditedBy         string       `json:"lastEditedBy"`
	ListItems            []ListItem   `json:"listItems"`
	DateCreated          string       `json:"dateCreated"`
	DateUpdated          string       `json:"dateUpdated"`
	OwnerID              OwnerDetails `json:"owner"`
	NumberOfItems        int          `json:"numberOfItems"`
	LikeCount            int          `json:"likeCount"`
	DoesUserHaveLike     bool         `json:"doesUserHaveLike"`
	NotificationsEnabled bool         `json:"notificationsEnabled"`
	//ListComments           []String     `json:"listComments"`
	IsUserAllowedToComment bool `json:"isUserAllowedToComment"`
	AllowsComments         bool `json:"allowsComments"`
}

type CreatedLists

type CreatedLists struct {
	Lists      []CreatedList `json:"lists"`
	TotalPages int           `json:"totalPages"`
}

type CurrentlyWatching

type CurrentlyWatching struct {
	Items      []WatchingItem `json:"items"`
	TotalItems int            `json:"totalItems"`
	TotalPages int            `json:"totalPages"`
}

type DiaryReviews

type DiaryReviews struct {
	ID               int          `json:"id"`
	ShowID           int          `json:"showId"`
	SeasonID         int          `json:"seasonId"`
	SeasonName       string       `json:"seasonName"`
	DateAdded        string       `json:"dateAdded"`
	Rating           int          `json:"rating"`
	ReviewText       string       `json:"reviewText"`
	Author           string       `json:"author"`
	AuthorImageUrl   string       `json:"authorImageUrl"`
	ContainsSpoiler  bool         `json:"containsSpoilers"`
	BackDate         string       `json:"backdate"`
	ShowName         string       `json:"showName"`
	ShowBannerImage  string       `json:"showBannerImage"`
	ShowSeasons      []ShowSeason `json:"showSeasons"`
	ShowPremiereDate string       `json:"showPremiereDate"`
	IsRewatched      bool         `json:"isRewatched"`
	IsLogged         bool         `json:"isLogged"`
	EpisodeNumber    int          `json:"episodeNumber"`
}

type Dropped

type Dropped struct {
	DroppedItems []DroppedItem `json:"items"`
	TotalItems   int           `json:"totalItems"`
	TotalPages   int           `json:"totalPages"`
}

type DroppedItem

type DroppedItem struct {
	ShowID      int    `json:"showId"`
	ShowName    string `json:"showName"`
	DateAdded   string `json:"dateAdded"`
	BannerImage string `json:"bannerImage"`
}

type Following

type Following struct {
	Users          []FollowingUser `json:"following"`
	TotalFollowing int             `json:"totalFollowing"`
	TotalPages     int             `json:"totalPages"`
}

type FollowingUser

type FollowingUser struct {
	Username    string `json:"username"`
	DateAdded   string `json:"dateAdded"`
	Description string `json:"description"`
	ImagePath   string `json:"imagePath"`
}

type ListItem

type ListItem struct {
	ShowID        int     `json:"showId"`
	Position      int     `json:"position"`
	DateAdded     string  `json:"dateAdded"`
	ShowName      string  `json:"showName"`
	BannerImage   string  `json:"bannerImage"`
	PremierDate   string  `json:"premierDate"`
	SeasonID      int     `json:"seasonId"`
	AverageRating float64 `json:"averageRating"`
	Season        int     `json:"season"`
	Episode       int     `json:"episode"`
	Description   string  `json:"description"`
}

type ListSortingOption

type ListSortingOption int
const (
	DateCreatedDesc ListSortingOption = iota
	DateCreatedAsc
	DateEditedDesc
	DataEditedAsc
	ListNameDesc
	ListNameAsc
	ItemCountDesc
	ItemCountAsc
)

type OwnerDetails

type OwnerDetails struct {
	Username string `json:"username"`
	ImageUrl string `json:"imageUrl"`
}

type Paused

type Paused struct {
	PausedItems []PausedItem `json:"items"`
	TotalItems  int          `json:"totalItems"`
	TotalPages  int          `json:"totalPages"`
}

type PausedItem

type PausedItem struct {
	ShowID      int    `json:"showId"`
	ShowName    string `json:"showName"`
	DateAdded   string `json:"dateAdded"`
	BannerImage string `json:"bannerImage"`
}

type PinnedReviews

type PinnedReviews struct {
	PinnedReviewItems []ReviewItem `json:"reviews"`
}

type ReviewItem

type ReviewItem struct {
	DateAdded           string       `json:"dateAdded"`
	Rating              int          `json:"rating"`
	Like                bool         `json:"like"`
	ID                  int          `json:"id"`
	ReviewText          string       `json:"reviewText"`
	SeasonID            int          `json:"seasonId"`
	ShowID              int          `json:"showId"`
	Author              string       `json:"author"`
	AuthorImageUrl      string       `json:"authorImageUrl"`
	ContainsSpoiler     bool         `json:"containsSpoiler"`
	BackDate            string       `json:"backdate"`
	ShowName            string       `json:"showName"`
	ShowBannerImage     string       `json:"showBannerImage"`
	ShowSeasons         []ShowSeason `json:"showSeasons"`
	ShowPremiereDate    string       `json:"showPremiereDate"`
	NumberOfComments    int          `json:"numComments"`
	NumberOfLikes       int          `json:"numLikes"`
	DoesUserHaveComment bool         `json:"doesUserHaveComment"`
	DoesUserHaveLike    bool         `json:"doesUserHaveLike"`
	IsRewatch           bool         `json:"isRewatch"`
	IsLog               bool         `json:"isLog"`
	EpisodeNumber       int          `json:"episodeNumber"`
	EpisodeName         string       `json:"episodeName"`
	Tags                []string     `json:"tags"`
	LikeCount           int          `json:"likeCount"`
}

type ReviewSortingOption

type ReviewSortingOption int
const (
	WhenWatchedDesc ReviewSortingOption = iota
	WhenWatchedAsc
	WhenReviewedDesc
	WhenReviewedAsc
	LowestRatingFirst
	HighestRatingFirst
	MostLikedFirst
	LeastLikedFirst
)

type Reviews

type Reviews struct {
	ReviewItems []ReviewItem `json:"items"`
}

type SerializdDiary

type SerializdDiary struct {
	Reviews      []DiaryReviews `json:"reviews"`
	TotalPages   int            `json:"totalPages"`
	TotalReviews int            `json:"totalReviews"`
}

type ShowSeason

type ShowSeason struct {
	ID           int    `json:"id"`
	Name         string `json:"name"`
	SeasonNumber int    `json:"seasonNumber"`
	PosterPath   string `json:"posterPath"`
}

type SortingOption

type SortingOption int
const (
	DateAddedDesc SortingOption = iota
	DateAddedAsc
	NameAsc
	NameDesc
	ReleaseDateDesc
	ReleaseDateAsc
	LastAiredDesc
	LastAiredAsc
)

type Tag

type Tag struct {
	Name  string `json:"name"`
	Count int    `json:"count"`
}

type Tags

type Tags struct {
	Tags []Tag `json:"tags"`
}

type Watched

type Watched struct {
	Items           []WatchedItem `json:"items"`
	TotalPages      int           `json:"totalPages"`
	NumberOfShows   int           `json:"numberOfShows"`
	NumberOfSeasons int           `json:"numberOfSeasons"`
}

type WatchedItem

type WatchedItem struct {
	ShowID           int    `json:"showId"`
	SeasonIDs        []int  `json:"seasonIds"`
	DateAdded        string `json:"dateAdded"`
	ShowName         string `json:"showName"`
	BannerImage      string `json:"bannerImage"`
	NumberOfSeasons  int    `json:"numSeasons"`
	NumberOfEpisodes int    `json:"numEpisodes"`
	PremierDate      string `json:"premierDate"`
}

type WatchingItem

type WatchingItem struct {
	ShowID      int    `json:"showId"`
	DateAdded   string `json:"dateAdded"`
	ShowName    string `json:"showName"`
	BannerImage string `json:"bannerImage"`
}

type Watchlist

type Watchlist struct {
	WatchlistItems  []WatchlistItem `json:"items"`
	TotalPages      int             `json:"totalPages"`
	NumberOfShows   int             `json:"numberOfShows"`
	NumberOfSeasons int             `json:"numberOfSeasons"`
}

type WatchlistItem

type WatchlistItem struct {
	ShowID           int    `json:"showId"`
	SeasonIDs        []int  `json:"seasonIds"`
	DateAdded        string `json:"dateAdded"`
	ShowName         string `json:"showName"`
	BannerImage      string `json:"bannerImage"`
	NumberOfSeasons  int    `json:"numSeasons"`
	NumberOfEpisodes int    `json:"numEpisodes"`
}

Jump to

Keyboard shortcuts

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