loader

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 16 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Conjunction_AND = Conjunction(0x0)
	Conjunction_OR  = Conjunction(0x1)
)
View Source
const (
	Field_NAME                   = Field(0x2)
	Field_ALBUM                  = Field(0x3)
	Field_ARTIST                 = Field(0x4)
	Field_BIT_RATE               = Field(0x5)
	Field_SAMPLE_RATE            = Field(0x6)
	Field_YEAR                   = Field(0x7)
	Field_GENRE                  = Field(0x8)
	Field_KIND                   = Field(0x9)
	Field_DATE_MODIFIED          = Field(0xA)
	Field_TRACK_NUMBER           = Field(0xB)
	Field_SIZE                   = Field(0xC)
	Field_TOTAL_TIME             = Field(0xD)
	Field_COMMENTS               = Field(0xE)
	Field_DATE_ADDED             = Field(0x10)
	Field_COMPOSER               = Field(0x12)
	Field_PLAY_COUNT             = Field(0x16)
	Field_PLAY_DATE_UTC          = Field(0x17)
	Field_DISK_NUMBER            = Field(0x18)
	Field_RATING                 = Field(0x19)
	Field_DISABLED               = Field(0x1D)
	Field_COMPILATION            = Field(0x1F)
	Field_BPM                    = Field(0x23)
	Field_HAS_ARTWORK            = Field(0x25)
	Field_GROUPING               = Field(0x27)
	Field_PLAYLIST_PERSISTENT_ID = Field(0x28)
	Field_PURCHASED              = Field(0x29)
	Field_DESCRIPTION            = Field(0x36)
	Field_CATEGORY               = Field(0x37)
	Field_PODCAST                = Field(0x39)
	Field_MEDIA_KIND             = Field(0x3C)
	Field_SERIES                 = Field(0x3E)
	Field_SEASON                 = Field(0x3F)
	Field_SKIP_COUNT             = Field(0x44)
	Field_SKIP_DATE              = Field(0x45)
	Field_ALBUM_ARTIST           = Field(0x47)
	Field_SORT_NAME              = Field(0x4E)
	Field_SORT_ALBUM             = Field(0x4F)
	Field_SORT_ALBUM_ARTIST      = Field(0x51)
	Field_SORT_COMPOSER          = Field(0x52)
	Field_SORT_SERIES            = Field(0x53)
	Field_VIDEO_RATING           = Field(0x59)
	Field_ALBUM_RATING           = Field(0x5A)
	Field_LOCATION               = Field(0x85)
	Field_ICLOUD_STATUS          = Field(0x86)
	Field_LOVE                   = Field(0x9A)
)
View Source
const (
	ICloudStatus_PURCHASED  = ICloudStatus(0x1)
	ICloudStatus_MATCHED    = ICloudStatus(0x2)
	ICloudStatus_UPLOADED   = ICloudStatus(0x3)
	ICloudStatus_INELIGIBLE = ICloudStatus(0x4)
	ICloudStatus_LOCALONLY  = ICloudStatus(0x5)
	ICloudStatus_DUPLICATE  = ICloudStatus(0x6)
)
View Source
const (
	LimitMethod_MINUTES = LimitMethod(0x1)
	LimitMethod_MB      = LimitMethod(0x2)
	LimitMethod_ITEMS   = LimitMethod(0x3)
	LimitMethod_HOURS   = LimitMethod(0x4)
	LimitMethod_GB      = LimitMethod(0x5)
)
View Source
const (
	LocationStatus_COMPUTER = LocationStatus(0x1)
	LocationStatus_ICLOUD   = LocationStatus(0x10)
)
View Source
const (
	LogicRule_OTHER       = LogicRule(0x0)
	LogicRule_IS          = LogicRule(0x1)
	LogicRule_CONTAINS    = LogicRule(0x2)
	LogicRule_STARTSWITH  = LogicRule(0x4)
	LogicRule_ENDSWITH    = LogicRule(0x8)
	LogicRule_GREATERTHAN = LogicRule(0x10)
	LogicRule_LESSTHAN    = LogicRule(0x40)
	LogicRule_BETWEEN     = LogicRule(0x100)
	LogicRule_WITHIN      = LogicRule(0x200)
)
View Source
const (
	LogicSign_INT_POS = LogicSign(0x0)
	LogicSign_STR_POS = LogicSign(0x1)
	LogicSign_INT_NEG = LogicSign(0x2)
	LogicSign_STR_NEG = LogicSign(0x3)
)
View Source
const (
	LoveStatus_NONE     = LoveStatus(0x0)
	LoveStatus_LOVED    = LoveStatus(0x2)
	LoveStatus_DISLIKED = LoveStatus(0x3)
)
View Source
const (
	MediaKind_MUSIC           = MediaKind(0x1)
	MediaKind_MOVIE           = MediaKind(0x2)
	MediaKind_PODCAST         = MediaKind(0x4)
	MediaKind_AUDIOBOOK       = MediaKind(0x8)
	MediaKind_MUSICVIDEO      = MediaKind(0x20)
	MediaKind_TVSHOW          = MediaKind(0x40)
	MediaKind_HOMEVIDEO       = MediaKind(0x400)
	MediaKind_ITUNESEXTRAS    = MediaKind(0x10000)
	MediaKind_VOICEMEMO       = MediaKind(0x100000)
	MediaKind_OTHERMUSIC      = MediaKind(0x1021B1)
	MediaKind_ITUNESU         = MediaKind(0x200000)
	MediaKind_UNDESIREDMUSIC  = MediaKind(0x208004)
	MediaKind_UNDESIREDOTHER  = MediaKind(0x20A004)
	MediaKind_BOOK            = MediaKind(0xC00000)
	MediaKind_BOOKORAUDIOBOOK = MediaKind(0xC00008)
)
View Source
const (
	SelectionMethod_LOWEST_RATING = SelectionMethod(0x1)
	SelectionMethod_RANDOM        = SelectionMethod(0x2)
	SelectionMethod_NAME          = SelectionMethod(0x5)
	SelectionMethod_ALBUM         = SelectionMethod(0x6)
	SelectionMethod_ARTIST        = SelectionMethod(0x7)
	SelectionMethod_GENRE         = SelectionMethod(0x9)
	SelectionMethod_DATE_ADDED    = SelectionMethod(0x15)
	SelectionMethod_PLAY_COUNT    = SelectionMethod(0x19)
	SelectionMethod_PLAY_DATE_UTC = SelectionMethod(0x1A)
	SelectionMethod_RATING        = SelectionMethod(0x1C)
)
View Source
const (
	RulesetField = iota + 1
	StringField
	IntField
	BooleanField
	DateField
	MediaKindField
	PlaylistField
	LoveField
	CloudField
	LocationField
)
View Source
const DateStartFromUnix = int64(-2082844800)

Variables

View Source
var AbortError = errors.New("abort")
View Source
var BadFieldError = errors.New("bad rule field")
View Source
var ConjunctionNames = map[Conjunction]string{
	Conjunction(0x0): "AND",
	Conjunction(0x1): "OR",
}
View Source
var ConjunctionValues = map[string]Conjunction{
	"AND": Conjunction(0x0),
	"OR":  Conjunction(0x1),
}
View Source
var FieldNames = map[Field]string{
	Field(0x2):  "name",
	Field(0x3):  "album",
	Field(0x4):  "artist",
	Field(0x5):  "bit_rate",
	Field(0x6):  "sample_rate",
	Field(0x7):  "year",
	Field(0x8):  "genre",
	Field(0x9):  "kind",
	Field(0xA):  "date_modified",
	Field(0xB):  "track_number",
	Field(0xC):  "size",
	Field(0xD):  "total_time",
	Field(0xE):  "comments",
	Field(0x10): "date_added",
	Field(0x12): "composer",
	Field(0x16): "play_count",
	Field(0x17): "play_date_utc",
	Field(0x18): "disk_number",
	Field(0x19): "rating",
	Field(0x1D): "disabled",
	Field(0x1F): "compilation",
	Field(0x23): "bpm",
	Field(0x25): "has_artwork",
	Field(0x27): "grouping",
	Field(0x28): "playlist_persistent_id",
	Field(0x29): "purchased",
	Field(0x36): "description",
	Field(0x37): "category",
	Field(0x39): "podcast",
	Field(0x3C): "media_kind",
	Field(0x3E): "series",
	Field(0x3F): "season",
	Field(0x44): "skip_count",
	Field(0x45): "skip_date",
	Field(0x47): "album_artist",
	Field(0x4E): "sort_name",
	Field(0x4F): "sort_album",
	Field(0x51): "sort_album_artist",
	Field(0x52): "sort_composer",
	Field(0x53): "sort_series",
	Field(0x59): "video_rating",
	Field(0x5A): "album_rating",
	Field(0x85): "location",
	Field(0x86): "icloud_status",
	Field(0x9A): "love",
}
View Source
var FieldValues = map[string]Field{
	"name":                   Field(0x2),
	"album":                  Field(0x3),
	"artist":                 Field(0x4),
	"bit_rate":               Field(0x5),
	"sample_rate":            Field(0x6),
	"year":                   Field(0x7),
	"genre":                  Field(0x8),
	"kind":                   Field(0x9),
	"date_modified":          Field(0xA),
	"track_number":           Field(0xB),
	"size":                   Field(0xC),
	"total_time":             Field(0xD),
	"comments":               Field(0xE),
	"date_added":             Field(0x10),
	"composer":               Field(0x12),
	"play_count":             Field(0x16),
	"play_date_utc":          Field(0x17),
	"disk_number":            Field(0x18),
	"rating":                 Field(0x19),
	"disabled":               Field(0x1D),
	"compilation":            Field(0x1F),
	"bpm":                    Field(0x23),
	"has_artwork":            Field(0x25),
	"grouping":               Field(0x27),
	"playlist_persistent_id": Field(0x28),
	"purchased":              Field(0x29),
	"description":            Field(0x36),
	"category":               Field(0x37),
	"podcast":                Field(0x39),
	"media_kind":             Field(0x3C),
	"series":                 Field(0x3E),
	"season":                 Field(0x3F),
	"skip_count":             Field(0x44),
	"skip_date":              Field(0x45),
	"album_artist":           Field(0x47),
	"sort_name":              Field(0x4E),
	"sort_album":             Field(0x4F),
	"sort_album_artist":      Field(0x51),
	"sort_composer":          Field(0x52),
	"sort_series":            Field(0x53),
	"video_rating":           Field(0x59),
	"album_rating":           Field(0x5A),
	"location":               Field(0x85),
	"icloud_status":          Field(0x86),
	"love":                   Field(0x9A),
}
View Source
var FileKinds = []FileKind{
	FileKind{"Protected AAC audio file", ".m4p"},
	FileKind{"MPEG audio file", ".mp3"},
	FileKind{"AIFF audio file", ".aiff"},
	FileKind{"WAV audio file", ".wav"},
	FileKind{"QuickTime movie file", ".mov"},
	FileKind{"MPEG-4 video file", ".mp4"},
	FileKind{"AAC audio file", ".m4a"},
}
View Source
var ICloudStatusNames = map[ICloudStatus]string{
	ICloudStatus(0x1): "Purchased",
	ICloudStatus(0x2): "Matched",
	ICloudStatus(0x3): "Uploaded",
	ICloudStatus(0x4): "Ineligible",
	ICloudStatus(0x5): "LocalOnly",
	ICloudStatus(0x6): "Duplicate",
}
View Source
var ICloudStatusValues = map[string]ICloudStatus{
	"Purchased":  ICloudStatus(0x1),
	"Matched":    ICloudStatus(0x2),
	"Uploaded":   ICloudStatus(0x3),
	"Ineligible": ICloudStatus(0x4),
	"LocalOnly":  ICloudStatus(0x5),
	"Duplicate":  ICloudStatus(0x6),
}
View Source
var LimitMethodNames = map[LimitMethod]string{
	LimitMethod(0x1): "minutes",
	LimitMethod(0x2): "MB",
	LimitMethod(0x3): "items",
	LimitMethod(0x4): "hours",
	LimitMethod(0x5): "GB",
}
View Source
var LimitMethodValues = map[string]LimitMethod{
	"minutes": LimitMethod(0x1),
	"MB":      LimitMethod(0x2),
	"items":   LimitMethod(0x3),
	"hours":   LimitMethod(0x4),
	"GB":      LimitMethod(0x5),
}
View Source
var LocationStatusNames = map[LocationStatus]string{
	LocationStatus(0x1):  "Computer",
	LocationStatus(0x10): "iCloud",
}
View Source
var LocationStatusValues = map[string]LocationStatus{
	"Computer": LocationStatus(0x1),
	"iCloud":   LocationStatus(0x10),
}
View Source
var LogicRuleNames = map[LogicRule]string{
	LogicRule(0x0):   "other",
	LogicRule(0x1):   "is",
	LogicRule(0x2):   "contains",
	LogicRule(0x4):   "startswith",
	LogicRule(0x8):   "endswith",
	LogicRule(0x10):  "greaterthan",
	LogicRule(0x40):  "lessthan",
	LogicRule(0x100): "between",
	LogicRule(0x200): "within",
}
View Source
var LogicRuleValues = map[string]LogicRule{
	"other":       LogicRule(0x0),
	"is":          LogicRule(0x1),
	"contains":    LogicRule(0x2),
	"startswith":  LogicRule(0x4),
	"endswith":    LogicRule(0x8),
	"greaterthan": LogicRule(0x10),
	"lessthan":    LogicRule(0x40),
	"between":     LogicRule(0x100),
	"within":      LogicRule(0x200),
}
View Source
var LogicSignNames = map[LogicSign]string{
	LogicSign(0x0): "int_pos",
	LogicSign(0x1): "str_pos",
	LogicSign(0x2): "int_neg",
	LogicSign(0x3): "str_neg",
}
View Source
var LogicSignValues = map[string]LogicSign{
	"int_pos": LogicSign(0x0),
	"str_pos": LogicSign(0x1),
	"int_neg": LogicSign(0x2),
	"str_neg": LogicSign(0x3),
}
View Source
var LoveStatusNames = map[LoveStatus]string{
	LoveStatus(0x0): "None",
	LoveStatus(0x2): "Loved",
	LoveStatus(0x3): "Disliked",
}
View Source
var LoveStatusValues = map[string]LoveStatus{
	"None":     LoveStatus(0x0),
	"Loved":    LoveStatus(0x2),
	"Disliked": LoveStatus(0x3),
}
View Source
var MediaKindNames = map[MediaKind]string{
	MediaKind(0x1):      "Music",
	MediaKind(0x2):      "Movie",
	MediaKind(0x4):      "Podcast",
	MediaKind(0x8):      "Audiobook",
	MediaKind(0x20):     "MusicVideo",
	MediaKind(0x40):     "TVShow",
	MediaKind(0x400):    "HomeVideo",
	MediaKind(0x10000):  "ITunesExtras",
	MediaKind(0x100000): "VoiceMemo",
	MediaKind(0x1021B1): "OtherMusic",
	MediaKind(0x200000): "ITunesU",
	MediaKind(0x208004): "UndesiredMusic",
	MediaKind(0x20A004): "UndesiredOther",
	MediaKind(0xC00000): "Book",
	MediaKind(0xC00008): "BookOrAudiobook",
}
View Source
var MediaKindValues = map[string]MediaKind{
	"Music":           MediaKind(0x1),
	"Movie":           MediaKind(0x2),
	"Podcast":         MediaKind(0x4),
	"Audiobook":       MediaKind(0x8),
	"MusicVideo":      MediaKind(0x20),
	"TVShow":          MediaKind(0x40),
	"HomeVideo":       MediaKind(0x400),
	"ITunesExtras":    MediaKind(0x10000),
	"VoiceMemo":       MediaKind(0x100000),
	"OtherMusic":      MediaKind(0x1021B1),
	"ITunesU":         MediaKind(0x200000),
	"UndesiredMusic":  MediaKind(0x208004),
	"UndesiredOther":  MediaKind(0x20A004),
	"Book":            MediaKind(0xC00000),
	"BookOrAudiobook": MediaKind(0xC00008),
}
View Source
var SelectionMethodNames = map[SelectionMethod]string{
	SelectionMethod(0x1):  "lowest_rating",
	SelectionMethod(0x2):  "<random>",
	SelectionMethod(0x5):  "name",
	SelectionMethod(0x6):  "album",
	SelectionMethod(0x7):  "artist",
	SelectionMethod(0x9):  "genre",
	SelectionMethod(0x15): "date_added",
	SelectionMethod(0x19): "play_count",
	SelectionMethod(0x1A): "play_date_utc",
	SelectionMethod(0x1C): "rating",
}
View Source
var SelectionMethodValues = map[string]SelectionMethod{
	"lowest_rating": SelectionMethod(0x1),
	"<random>":      SelectionMethod(0x2),
	"name":          SelectionMethod(0x5),
	"album":         SelectionMethod(0x6),
	"artist":        SelectionMethod(0x7),
	"genre":         SelectionMethod(0x9),
	"date_added":    SelectionMethod(0x15),
	"play_count":    SelectionMethod(0x19),
	"play_date_utc": SelectionMethod(0x1A),
	"rating":        SelectionMethod(0x1C),
}

Functions

func Boolp added in v0.1.0

func Boolp(b bool) *bool

func Int16p added in v0.1.0

func Int16p(i int16) *int16

func Int32p added in v0.1.0

func Int32p(i int32) *int32

func Int64p added in v0.1.0

func Int64p(i int64) *int64

func Int8p added in v0.1.0

func Int8p(i int8) *int8

func Intp added in v0.1.0

func Intp(i int) *int

func StringToUTF16Bytes added in v0.3.1

func StringToUTF16Bytes(s string, o binary.ByteOrder) []byte

func Stringp added in v0.1.0

func Stringp(s string) *string

func Timep added in v0.1.0

func Timep(t time.Time) *time.Time

func UTF16BytesToString added in v0.3.1

func UTF16BytesToString(b []byte, o binary.ByteOrder) string

UTF16BytesToString converts UTF-16 encoded bytes, in big or little endian byte order, to a UTF-8 encoded string.

func Uint16p added in v0.1.0

func Uint16p(i uint16) *uint16

func Uint32p added in v0.1.0

func Uint32p(i uint32) *uint32

func Uint64p added in v0.1.0

func Uint64p(i uint64) *uint64

func Uint8p added in v0.1.0

func Uint8p(i uint8) *uint8

func Uintp added in v0.1.0

func Uintp(i uint) *uint

Types

type BaseLoader added in v0.1.0

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

func NewBaseLoader added in v0.1.0

func NewBaseLoader() *BaseLoader

func (*BaseLoader) Abort added in v0.1.0

func (l *BaseLoader) Abort()

func (*BaseLoader) GetChan added in v0.1.0

func (l *BaseLoader) GetChan() chan interface{}

func (*BaseLoader) GetQuitChan added in v0.1.0

func (l *BaseLoader) GetQuitChan() chan bool

func (*BaseLoader) Shutdown added in v0.1.0

func (l *BaseLoader) Shutdown(err error)

type Conjunction added in v0.3.1

type Conjunction int

func (Conjunction) MarshalJSON added in v0.3.1

func (e Conjunction) MarshalJSON() ([]byte, error)

func (Conjunction) String added in v0.3.1

func (e Conjunction) String() string

func (*Conjunction) UnmarshalJSON added in v0.3.1

func (e *Conjunction) UnmarshalJSON(data []byte) error

type Field added in v0.3.1

type Field int

func (Field) MarshalJSON added in v0.3.1

func (e Field) MarshalJSON() ([]byte, error)

func (Field) String added in v0.3.1

func (e Field) String() string

func (Field) Type added in v0.3.1

func (f Field) Type() FieldType

func (*Field) UnmarshalJSON added in v0.3.1

func (e *Field) UnmarshalJSON(data []byte) error

type FieldType added in v0.3.1

type FieldType int

type FileKind added in v0.3.1

type FileKind struct {
	Name      string `json:"name"`
	Extension string `json:"ext"`
}

type ICloudStatus added in v0.3.1

type ICloudStatus int

func (ICloudStatus) MarshalJSON added in v0.3.1

func (e ICloudStatus) MarshalJSON() ([]byte, error)

func (ICloudStatus) String added in v0.3.1

func (e ICloudStatus) String() string

func (*ICloudStatus) UnmarshalJSON added in v0.3.1

func (e *ICloudStatus) UnmarshalJSON(data []byte) error

type IntRuleData added in v0.3.1

type IntRuleData struct {
	Junk1 [4]byte
	IntA  uint32
	RelA  int64
	Junk2 [4]byte
	BoolB uint32
	Junk3 [4]byte
	IntB  uint32
	Junk4 [12]byte
	BoolC uint32
	Junk5 [4]byte
	IntC  uint32
	Junk6 [12]byte
}

func (*IntRuleData) Decode added in v0.3.1

func (ird *IntRuleData) Decode(data []byte) error

func (*IntRuleData) Encode added in v0.3.1

func (ird *IntRuleData) Encode() ([]byte, error)

func (IntRuleData) Ints added in v0.3.1

func (ird IntRuleData) Ints() []int64

func (IntRuleData) Times added in v0.3.1

func (ird IntRuleData) Times() []*Time

type Library

type Library struct {
	FileName           *string
	MajorVersion       *int
	MinorVersion       *int
	ApplicationVersion *string
	Date               *time.Time
	Features           *int
	ShowContentRatings *bool
	PersistentID       *pid.PersistentID `plist:"Library Persistent ID"`
	MusicFolder        *string
	Tracks             *int
	Playlists          *int
}

func (*Library) GetApplicationVersion

func (lib *Library) GetApplicationVersion() string

func (*Library) GetDate

func (lib *Library) GetDate() time.Time

func (*Library) GetFeatures

func (lib *Library) GetFeatures() int

func (*Library) GetFileName

func (lib *Library) GetFileName() string

func (*Library) GetMajorVersion

func (lib *Library) GetMajorVersion() int

func (*Library) GetMinorVersion

func (lib *Library) GetMinorVersion() int

func (*Library) GetMusicFolder

func (lib *Library) GetMusicFolder() string

func (*Library) GetPersistentID

func (lib *Library) GetPersistentID() pid.PersistentID

func (*Library) GetPlaylists

func (lib *Library) GetPlaylists() int

func (*Library) GetShowContentRatings

func (lib *Library) GetShowContentRatings() bool

func (*Library) GetTracks

func (lib *Library) GetTracks() int

type LimitMethod added in v0.3.1

type LimitMethod int

func (LimitMethod) MarshalJSON added in v0.3.1

func (e LimitMethod) MarshalJSON() ([]byte, error)

func (LimitMethod) String added in v0.3.1

func (e LimitMethod) String() string

func (*LimitMethod) UnmarshalJSON added in v0.3.1

func (e *LimitMethod) UnmarshalJSON(data []byte) error

type Loader

type Loader interface {
	LoadFile(fn string)
	Load(f io.ReadCloser)
	Shutdown(err error)
	GetChan() chan interface{}
	Abort()
}

type LocationStatus added in v0.3.1

type LocationStatus int

func (LocationStatus) MarshalJSON added in v0.3.1

func (e LocationStatus) MarshalJSON() ([]byte, error)

func (LocationStatus) String added in v0.3.1

func (e LocationStatus) String() string

func (*LocationStatus) UnmarshalJSON added in v0.3.1

func (e *LocationStatus) UnmarshalJSON(data []byte) error

type LogicRule added in v0.3.1

type LogicRule int

func (LogicRule) MarshalJSON added in v0.3.1

func (e LogicRule) MarshalJSON() ([]byte, error)

func (LogicRule) String added in v0.3.1

func (e LogicRule) String() string

func (*LogicRule) UnmarshalJSON added in v0.3.1

func (e *LogicRule) UnmarshalJSON(data []byte) error

type LogicSign added in v0.3.1

type LogicSign int

func (LogicSign) MarshalJSON added in v0.3.1

func (e LogicSign) MarshalJSON() ([]byte, error)

func (LogicSign) String added in v0.3.1

func (e LogicSign) String() string

func (*LogicSign) UnmarshalJSON added in v0.3.1

func (e *LogicSign) UnmarshalJSON(data []byte) error

type LoveStatus added in v0.3.1

type LoveStatus int

func (LoveStatus) MarshalJSON added in v0.3.1

func (e LoveStatus) MarshalJSON() ([]byte, error)

func (LoveStatus) String added in v0.3.1

func (e LoveStatus) String() string

func (*LoveStatus) UnmarshalJSON added in v0.3.1

func (e *LoveStatus) UnmarshalJSON(data []byte) error

type MediaKind added in v0.3.1

type MediaKind int

func (MediaKind) MarshalJSON added in v0.3.1

func (e MediaKind) MarshalJSON() ([]byte, error)

func (MediaKind) String added in v0.3.1

func (e MediaKind) String() string

func (*MediaKind) UnmarshalJSON added in v0.3.1

func (e *MediaKind) UnmarshalJSON(data []byte) error

type Playlist

type Playlist struct {
	AllItems           *bool
	Audiobooks         *bool
	DistinguishedKind  *int
	Folder             *bool
	GeniusTrackID      *pid.PersistentID
	Master             *bool
	Movies             *bool
	Music              *bool
	Name               *string
	ParentPersistentID *pid.PersistentID
	PlaylistID         *int
	PersistentID       *pid.PersistentID `plist:"Playlist Persistent ID"`
	Podcasts           *bool
	PurchasedMusic     *bool
	SmartCriteria      []byte
	SmartInfo          []byte
	TVShows            *bool
	Visible            *bool
	DateAdded          *time.Time
	DateModified       *time.Time
	Smart              *SmartPlaylist
	SortField          *string
	TrackIDs           []pid.PersistentID
}

func NewPlaylist

func NewPlaylist() *Playlist

func (*Playlist) GetAllItems

func (pl *Playlist) GetAllItems() bool

func (*Playlist) GetAudiobooks

func (pl *Playlist) GetAudiobooks() bool

func (*Playlist) GetDistinguishedKind

func (pl *Playlist) GetDistinguishedKind() int

func (*Playlist) GetFolder

func (pl *Playlist) GetFolder() bool

func (*Playlist) GetGeniusTrackID

func (pl *Playlist) GetGeniusTrackID() pid.PersistentID

func (*Playlist) GetMaster

func (pl *Playlist) GetMaster() bool

func (*Playlist) GetMovies

func (pl *Playlist) GetMovies() bool

func (*Playlist) GetMusic

func (pl *Playlist) GetMusic() bool

func (*Playlist) GetName

func (pl *Playlist) GetName() string

func (*Playlist) GetParentPersistentID

func (pl *Playlist) GetParentPersistentID() pid.PersistentID

func (*Playlist) GetPersistentID

func (pl *Playlist) GetPersistentID() pid.PersistentID

func (*Playlist) GetPlaylistID

func (pl *Playlist) GetPlaylistID() int

func (*Playlist) GetPodcasts

func (pl *Playlist) GetPodcasts() bool

func (*Playlist) GetPurchasedMusic

func (pl *Playlist) GetPurchasedMusic() bool

func (*Playlist) GetTVShows

func (pl *Playlist) GetTVShows() bool

func (*Playlist) GetVisible

func (pl *Playlist) GetVisible() bool

func (*Playlist) IsSmart

func (p *Playlist) IsSmart() bool

type RuleHeader added in v0.3.1

type RuleHeader struct {
	FieldId     uint32
	LogicSignId uint8
	Junk1       byte
	LogicRuleId uint16
	Junk2       [44]byte
	Length      uint32
}

func (RuleHeader) Field added in v0.3.1

func (rh RuleHeader) Field() Field

func (RuleHeader) LogicRule added in v0.3.1

func (rh RuleHeader) LogicRule() LogicRule

func (RuleHeader) LogicSign added in v0.3.1

func (rh RuleHeader) LogicSign() LogicSign

type RuleSetHeader added in v0.3.1

type RuleSetHeader struct {
	Junk1         [8]byte
	RuleCount     uint32
	ConjunctionId uint32
	Junk2         [120]byte
}

type SelectionMethod added in v0.3.1

type SelectionMethod int

func (SelectionMethod) MarshalJSON added in v0.3.1

func (e SelectionMethod) MarshalJSON() ([]byte, error)

func (SelectionMethod) String added in v0.3.1

func (e SelectionMethod) String() string

func (*SelectionMethod) UnmarshalJSON added in v0.3.1

func (e *SelectionMethod) UnmarshalJSON(data []byte) error

type SmartPlaylist added in v0.3.1

type SmartPlaylist struct {
	Info     *SmartPlaylistInfo     `json:"info"`
	Criteria *SmartPlaylistCriteria `json:"criteria"`
	// contains filtered or unexported fields
}

func ParseSmartPlaylist added in v0.3.1

func ParseSmartPlaylist(info, criteria []byte, order binary.ByteOrder) (*SmartPlaylist, error)

func (*SmartPlaylist) Encode added in v0.3.1

func (s *SmartPlaylist) Encode() (info []byte, criteria []byte, err error)

type SmartPlaylistBooleanRule added in v0.3.1

type SmartPlaylistBooleanRule struct {
	*SmartPlaylistCommonRule
	RuleType string `json:"type"`
	Value    bool   `json:"value"`
}

func NewSmartPlaylistBooleanRule added in v0.3.1

func NewSmartPlaylistBooleanRule(ruleHeader *RuleHeader, value []byte, order binary.ByteOrder) *SmartPlaylistBooleanRule

func (*SmartPlaylistBooleanRule) Encode added in v0.3.1

func (r *SmartPlaylistBooleanRule) Encode() ([]byte, error)

type SmartPlaylistCloudRule added in v0.3.1

type SmartPlaylistCloudRule struct {
	*SmartPlaylistCommonRule
	RuleType string       `json:"type"`
	Value    ICloudStatus `json:"value"`
}

func NewSmartPlaylistCloudRule added in v0.3.1

func NewSmartPlaylistCloudRule(ruleHeader *RuleHeader, value []byte, order binary.ByteOrder) *SmartPlaylistCloudRule

func (*SmartPlaylistCloudRule) Encode added in v0.3.1

func (r *SmartPlaylistCloudRule) Encode() ([]byte, error)

type SmartPlaylistCommonRule added in v0.3.1

type SmartPlaylistCommonRule struct {
	Field    Field     `json:"field"`
	Sign     LogicSign `json:"sign"`
	Operator LogicRule `json:"operator"`
	// contains filtered or unexported fields
}

func NewSmartPlaylistCommonRule added in v0.3.1

func NewSmartPlaylistCommonRule(ruleHeader *RuleHeader, value []byte, order binary.ByteOrder) *SmartPlaylistCommonRule

func (*SmartPlaylistCommonRule) EncodeHeader added in v0.3.1

func (r *SmartPlaylistCommonRule) EncodeHeader(value []byte) ([]byte, error)

func (*SmartPlaylistCommonRule) GetField added in v0.3.1

func (r *SmartPlaylistCommonRule) GetField(track *Track, kind reflect.Kind, typ reflect.Type) (reflect.Value, error)

type SmartPlaylistCriteria added in v0.3.1

type SmartPlaylistCriteria struct {
	Conjunction Conjunction `json:"conjunction"`
	Rules       []SmartRule `json:"rules"`
	// contains filtered or unexported fields
}

func (*SmartPlaylistCriteria) Encode added in v0.3.1

func (c *SmartPlaylistCriteria) Encode() ([]byte, error)

func (*SmartPlaylistCriteria) EncodeHeader added in v0.3.1

func (c *SmartPlaylistCriteria) EncodeHeader(value []byte) ([]byte, error)

func (*SmartPlaylistCriteria) Parse added in v0.3.1

func (c *SmartPlaylistCriteria) Parse(raw []byte) error

type SmartPlaylistDateRule added in v0.3.1

type SmartPlaylistDateRule struct {
	*SmartPlaylistCommonRule
	RuleType string  `json:"type"`
	Values   []*Time `json:"values"`
	Relative int64   `json:"relative"`
}

func NewSmartPlaylistDateRule added in v0.3.1

func NewSmartPlaylistDateRule(ruleHeader *RuleHeader, value []byte, order binary.ByteOrder) *SmartPlaylistDateRule

func (*SmartPlaylistDateRule) Encode added in v0.3.1

func (r *SmartPlaylistDateRule) Encode() ([]byte, error)

type SmartPlaylistInfo added in v0.3.1

type SmartPlaylistInfo struct {
	CheckedOnly  bool             `json:"checked_only"`
	Descending   bool             `json:"descending"`
	HasLimit     bool             `json:"has_limit"`
	LiveUpdating bool             `json:"live_updating"`
	LimitUnit    *LimitMethod     `json:"limit_method"`
	LimitSize    *int             `json:"limit_size"`
	SortField    *SelectionMethod `json:"sort_field"`
	// contains filtered or unexported fields
}

func (*SmartPlaylistInfo) Encode added in v0.3.1

func (inf *SmartPlaylistInfo) Encode() ([]byte, error)

func (*SmartPlaylistInfo) Parse added in v0.3.1

func (inf *SmartPlaylistInfo) Parse(raw []byte) error

type SmartPlaylistIntegerRule added in v0.3.1

type SmartPlaylistIntegerRule struct {
	*SmartPlaylistCommonRule
	RuleType string  `json:"type"`
	Values   []int64 `json:"values"`
}

func NewSmartPlaylistIntegerRule added in v0.3.1

func NewSmartPlaylistIntegerRule(ruleHeader *RuleHeader, value []byte, order binary.ByteOrder) *SmartPlaylistIntegerRule

func (*SmartPlaylistIntegerRule) Encode added in v0.3.1

func (r *SmartPlaylistIntegerRule) Encode() ([]byte, error)

type SmartPlaylistLocationRule added in v0.3.1

type SmartPlaylistLocationRule struct {
	*SmartPlaylistCommonRule
	RuleType string         `json:"type"`
	Value    LocationStatus `json:"value"`
}

func NewSmartPlaylistLocationRule added in v0.3.1

func NewSmartPlaylistLocationRule(ruleHeader *RuleHeader, value []byte, order binary.ByteOrder) *SmartPlaylistLocationRule

func (*SmartPlaylistLocationRule) Encode added in v0.3.1

func (r *SmartPlaylistLocationRule) Encode() ([]byte, error)

type SmartPlaylistLoveRule added in v0.3.1

type SmartPlaylistLoveRule struct {
	*SmartPlaylistCommonRule
	RuleType string     `json:"type"`
	Value    LoveStatus `json:"value"`
}

func NewSmartPlaylistLoveRule added in v0.3.1

func NewSmartPlaylistLoveRule(ruleHeader *RuleHeader, value []byte, order binary.ByteOrder) *SmartPlaylistLoveRule

func (*SmartPlaylistLoveRule) Encode added in v0.3.1

func (r *SmartPlaylistLoveRule) Encode() ([]byte, error)

type SmartPlaylistMediaKindRule added in v0.3.1

type SmartPlaylistMediaKindRule struct {
	*SmartPlaylistCommonRule
	RuleType string    `json:"type"`
	Value    MediaKind `json:"value"`
}

func NewSmartPlaylistMediaKindRule added in v0.3.1

func NewSmartPlaylistMediaKindRule(ruleHeader *RuleHeader, value []byte, order binary.ByteOrder) *SmartPlaylistMediaKindRule

func (*SmartPlaylistMediaKindRule) Encode added in v0.3.1

func (r *SmartPlaylistMediaKindRule) Encode() ([]byte, error)

type SmartPlaylistPlaylistRule added in v0.3.1

type SmartPlaylistPlaylistRule struct {
	*SmartPlaylistCommonRule
	RuleType string           `json:"type"`
	Value    pid.PersistentID `json:"value"`
	// contains filtered or unexported fields
}

func NewSmartPlaylistPlaylistRule added in v0.3.1

func NewSmartPlaylistPlaylistRule(ruleHeader *RuleHeader, value []byte, order binary.ByteOrder) *SmartPlaylistPlaylistRule

func (*SmartPlaylistPlaylistRule) Encode added in v0.3.1

func (r *SmartPlaylistPlaylistRule) Encode() ([]byte, error)

type SmartPlaylistStringRule added in v0.3.1

type SmartPlaylistStringRule struct {
	*SmartPlaylistCommonRule
	RuleType string `json:"type"`
	Value    string `json:"value"`
}

func NewSmartPlaylistStringRule added in v0.3.1

func NewSmartPlaylistStringRule(ruleHeader *RuleHeader, value []byte, order binary.ByteOrder) *SmartPlaylistStringRule

func (*SmartPlaylistStringRule) Encode added in v0.3.1

func (r *SmartPlaylistStringRule) Encode() ([]byte, error)

type SmartRule added in v0.3.1

type SmartRule interface {
	EncodeHeader([]byte) ([]byte, error)
	Encode() ([]byte, error)
}

type Time added in v0.3.1

type Time struct {
	time.Time
}

func (*Time) EpochMS added in v0.3.1

func (t *Time) EpochMS() int64

func (*Time) Get added in v0.3.1

func (t *Time) Get() time.Time

func (*Time) MarshalJSON added in v0.3.1

func (t *Time) MarshalJSON() ([]byte, error)

func (*Time) Set added in v0.3.1

func (t *Time) Set(tm time.Time)

func (*Time) SetEpochMS added in v0.3.1

func (t *Time) SetEpochMS(ms int64)

func (*Time) UnmarshalJSON added in v0.3.1

func (t *Time) UnmarshalJSON(data []byte) error

func (*Time) UnmarshalPlist added in v0.3.1

func (t *Time) UnmarshalPlist(obj interface{}) error

type Track

type Track struct {
	Album               *string
	AlbumArtist         *string
	AlbumRating         *uint8
	AlbumRatingComputed *bool
	Artist              *string
	ArtworkCount        *int
	BPM                 *uint16
	BitRate             *uint
	Clean               *bool
	Comments            *string
	Compilation         *bool
	Composer            *string
	ContentRating       *string
	DateAdded           *time.Time
	DateModified        *time.Time
	Disabled            *bool
	DiscCount           *uint8
	DiscNumber          *uint8
	Episode             *string
	EpisodeOrder        *int
	Explicit            *bool
	FileFolderCount     *int
	FileType            *int
	Genre               *string
	Grouping            *string
	HasVideo            *bool
	Kind                *string
	LibraryFolderCount  *int
	Location            *string
	Loved               *bool
	Master              *bool
	MovementCount       *int
	MovementName        *string
	MovementNumber      *int
	Movie               *bool
	MusicVideo          *bool
	Name                *string
	PartOfGaplessAlbum  *bool
	PersistentID        *pid.PersistentID
	PlayCount           *uint
	PlayDateGarbage     *int       `plist:"Play Date"`
	PlayDate            *time.Time `plist:"Play Date UTC"`
	Podcast             *bool
	Protected           *bool
	PurchaseDate        *time.Time
	Purchased           *bool
	Rating              *uint8
	RatingComputed      *bool
	ReleaseDate         *time.Time
	SampleRate          *uint
	Season              *int
	Series              *string
	Size                *uint64
	SkipCount           *uint
	SkipDate            *time.Time
	SortAlbum           *string
	SortAlbumArtist     *string
	SortArtist          *string
	SortComposer        *string
	SortName            *string
	SortSeries          *string
	StartTime           *int
	StopTime            *int
	TVShow              *bool
	TotalTime           *uint
	TrackCount          *uint8
	TrackID             *int
	TrackNumber         *uint8
	TrackType           *string
	Unplayed            *bool
	VolumeAdjustment    *uint8
	Work                *string
	Year                *int
}

func (*Track) Clone

func (tr *Track) Clone() *Track

func (*Track) GetAlbum

func (tr *Track) GetAlbum() string

func (*Track) GetAlbumArtist

func (tr *Track) GetAlbumArtist() string

func (*Track) GetAlbumRating

func (tr *Track) GetAlbumRating() uint8

func (*Track) GetAlbumRatingComputed

func (tr *Track) GetAlbumRatingComputed() bool

func (*Track) GetArtist

func (tr *Track) GetArtist() string

func (*Track) GetArtworkCount

func (tr *Track) GetArtworkCount() int

func (*Track) GetBPM

func (tr *Track) GetBPM() uint16

func (*Track) GetBitRate

func (tr *Track) GetBitRate() uint

func (*Track) GetClean

func (tr *Track) GetClean() bool

func (*Track) GetComments

func (tr *Track) GetComments() string

func (*Track) GetCompilation

func (tr *Track) GetCompilation() bool

func (*Track) GetComposer

func (tr *Track) GetComposer() string

func (*Track) GetContentRating

func (tr *Track) GetContentRating() string

func (*Track) GetDateAdded

func (tr *Track) GetDateAdded() time.Time

func (*Track) GetDateModified

func (tr *Track) GetDateModified() time.Time

func (*Track) GetDisabled

func (tr *Track) GetDisabled() bool

func (*Track) GetDiscCount

func (tr *Track) GetDiscCount() uint8

func (*Track) GetDiscNumber

func (tr *Track) GetDiscNumber() uint8

func (*Track) GetEpisode

func (tr *Track) GetEpisode() string

func (*Track) GetEpisodeOrder

func (tr *Track) GetEpisodeOrder() int

func (*Track) GetExplicit

func (tr *Track) GetExplicit() bool

func (*Track) GetFileFolderCount

func (tr *Track) GetFileFolderCount() int

func (*Track) GetFileType

func (tr *Track) GetFileType() int

func (*Track) GetGenre

func (tr *Track) GetGenre() string

func (*Track) GetGrouping

func (tr *Track) GetGrouping() string

func (*Track) GetHasVideo

func (tr *Track) GetHasVideo() bool

func (*Track) GetKind

func (tr *Track) GetKind() string

func (*Track) GetLibraryFolderCount

func (tr *Track) GetLibraryFolderCount() int

func (*Track) GetLocation

func (tr *Track) GetLocation() string

func (*Track) GetLoved

func (tr *Track) GetLoved() bool

func (*Track) GetMaster

func (tr *Track) GetMaster() bool

func (*Track) GetMovementCount

func (tr *Track) GetMovementCount() int

func (*Track) GetMovementName

func (tr *Track) GetMovementName() string

func (*Track) GetMovementNumber

func (tr *Track) GetMovementNumber() int

func (*Track) GetMovie

func (tr *Track) GetMovie() bool

func (*Track) GetMusicVideo

func (tr *Track) GetMusicVideo() bool

func (*Track) GetName

func (tr *Track) GetName() string

func (*Track) GetPartOfGaplessAlbum

func (tr *Track) GetPartOfGaplessAlbum() bool

func (*Track) GetPersistentID

func (tr *Track) GetPersistentID() pid.PersistentID

func (*Track) GetPlayCount

func (tr *Track) GetPlayCount() uint

func (*Track) GetPlayDate

func (tr *Track) GetPlayDate() time.Time

func (*Track) GetPlayDateGarbage

func (tr *Track) GetPlayDateGarbage() int

func (*Track) GetPodcast

func (tr *Track) GetPodcast() bool

func (*Track) GetProtected

func (tr *Track) GetProtected() bool

func (*Track) GetPurchaseDate

func (tr *Track) GetPurchaseDate() time.Time

func (*Track) GetPurchased

func (tr *Track) GetPurchased() bool

func (*Track) GetRating

func (tr *Track) GetRating() uint8

func (*Track) GetRatingComputed

func (tr *Track) GetRatingComputed() bool

func (*Track) GetReleaseDate

func (tr *Track) GetReleaseDate() time.Time

func (*Track) GetSampleRate

func (tr *Track) GetSampleRate() uint

func (*Track) GetSeason

func (tr *Track) GetSeason() int

func (*Track) GetSeries

func (tr *Track) GetSeries() string

func (*Track) GetSize

func (tr *Track) GetSize() uint64

func (*Track) GetSkipCount

func (tr *Track) GetSkipCount() uint

func (*Track) GetSkipDate

func (tr *Track) GetSkipDate() time.Time

func (*Track) GetSortAlbum

func (tr *Track) GetSortAlbum() string

func (*Track) GetSortAlbumArtist

func (tr *Track) GetSortAlbumArtist() string

func (*Track) GetSortArtist

func (tr *Track) GetSortArtist() string

func (*Track) GetSortComposer

func (tr *Track) GetSortComposer() string

func (*Track) GetSortName

func (tr *Track) GetSortName() string

func (*Track) GetSortSeries

func (tr *Track) GetSortSeries() string

func (*Track) GetStopTime

func (tr *Track) GetStopTime() int

func (*Track) GetTVShow

func (tr *Track) GetTVShow() bool

func (*Track) GetTotalTime

func (tr *Track) GetTotalTime() uint

func (*Track) GetTrackCount

func (tr *Track) GetTrackCount() uint8

func (*Track) GetTrackID

func (tr *Track) GetTrackID() int

func (*Track) GetTrackNumber

func (tr *Track) GetTrackNumber() uint8

func (*Track) GetTrackType

func (tr *Track) GetTrackType() string

func (*Track) GetUnplayed

func (tr *Track) GetUnplayed() bool

func (*Track) GetVolumeAdjustment

func (tr *Track) GetVolumeAdjustment() uint8

func (*Track) GetWork

func (tr *Track) GetWork() string

func (*Track) GetYear

func (tr *Track) GetYear() int

Jump to

Keyboard shortcuts

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