collection

package
v0.33.15 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: AGPL-3.0, AGPL-3.0-only Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectPrivacy

type CollectPrivacy uint8
const (
	// CollectPrivacyNone 默认公开收藏。
	CollectPrivacyNone CollectPrivacy = 0
	// CollectPrivacySelf 私有收藏,正常计入评分。
	CollectPrivacySelf CollectPrivacy = 1
	// CollectPrivacyBan Shadow Ban, 显示为私有收藏,不计入评分。
	CollectPrivacyBan CollectPrivacy = 2
)

type EpisodeCollection

type EpisodeCollection uint8
const (
	EpisodeCollectionNone    EpisodeCollection = 0 // 撤消/删除
	EpisodeCollectionAll     EpisodeCollection = 0 // 全部
	EpisodeCollectionWish    EpisodeCollection = 1 // 想看
	EpisodeCollectionDone    EpisodeCollection = 2 // 看过
	EpisodeCollectionDropped EpisodeCollection = 3 // 抛弃
)

func (*EpisodeCollection) UnmarshalJSON

func (s *EpisodeCollection) UnmarshalJSON(bytes []byte) error

type Subject

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

func NewEmptySubjectCollection added in v0.32.9

func NewEmptySubjectCollection(subject model.SubjectID, user model.UserID) *Subject

func NewSubjectCollection

func NewSubjectCollection(
	subject model.SubjectID,
	user model.UserID,
	rate uint8,
	typeID SubjectCollection,
	comment string,
	privacy CollectPrivacy,
	tags []string,
	vols uint32,
	eps uint32,
) (*Subject, error)

func (*Subject) Comment

func (s *Subject) Comment() string

func (*Subject) Eps

func (s *Subject) Eps() uint32

func (*Subject) MakePrivate

func (s *Subject) MakePrivate()

func (*Subject) MakePublic

func (s *Subject) MakePublic()

func (*Subject) Privacy

func (s *Subject) Privacy() CollectPrivacy

func (*Subject) Rate

func (s *Subject) Rate() uint8

func (*Subject) ShadowBan

func (s *Subject) ShadowBan(v bool)

func (*Subject) Subject

func (s *Subject) Subject() model.SubjectID

func (*Subject) Tags

func (s *Subject) Tags() []string

func (*Subject) TypeID

func (s *Subject) TypeID() SubjectCollection

func (*Subject) UpdateComment

func (s *Subject) UpdateComment(comment string) error

func (*Subject) UpdateEps

func (s *Subject) UpdateEps(v uint32)

func (*Subject) UpdateRate

func (s *Subject) UpdateRate(r uint8, state SubjectCollection) error

func (*Subject) UpdateTags

func (s *Subject) UpdateTags(tags []string) error

func (*Subject) UpdateType

func (s *Subject) UpdateType(r SubjectCollection)

func (*Subject) UpdateVols

func (s *Subject) UpdateVols(v uint32)

func (*Subject) User

func (s *Subject) User() model.UserID

func (*Subject) Vols

func (s *Subject) Vols() uint32

type SubjectCollection

type SubjectCollection uint8
const (
	SubjectCollectionAll     SubjectCollection = 0 // 全部
	SubjectCollectionWish    SubjectCollection = 1 // 想看
	SubjectCollectionDone    SubjectCollection = 2 // 看过
	SubjectCollectionDoing   SubjectCollection = 3 // 在看
	SubjectCollectionOnHold  SubjectCollection = 4 // 搁置
	SubjectCollectionDropped SubjectCollection = 5 // 抛弃
)

func (*SubjectCollection) UnmarshalJSON

func (s *SubjectCollection) UnmarshalJSON(bytes []byte) error

type UserEpisodeCollection

type UserEpisodeCollection struct {
	ID   model.EpisodeID
	Type EpisodeCollection
}

type UserSubjectCollection

type UserSubjectCollection struct {
	UpdatedAt   time.Time
	Comment     string
	Tags        []string
	VolStatus   uint32
	EpStatus    uint32
	SubjectID   model.SubjectID
	SubjectType uint8
	Rate        uint8
	Type        SubjectCollection
	Private     bool
}

type UserSubjectEpisodesCollection

type UserSubjectEpisodesCollection map[model.EpisodeID]UserEpisodeCollection

Jump to

Keyboard shortcuts

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