9 // See the constants list for valid values.
10 type GroupRelationType int
13 GroupParticipantIn = GroupRelationType(1 + iota)
20 GroupChildOf = GroupRelationType(102)
23 func (gr GroupRelationType) String() string {
25 case GroupParticipantIn:
26 return "Participated In"
42 type GroupRelations map[GID]GroupRelationType
44 func (gr GroupRelations) MarshalJSON() ([]byte, error) {
45 generic := make(map[string]int, len(gr))
46 for k, v := range gr {
47 generic[strconv.Itoa(int(k))] = int(v)
49 return json.Marshal(generic)
52 func (gr GroupRelations) UnmarshalJSON(b []byte) error {
53 var generic map[string]int
54 if err := json.Unmarshal(b, &generic); err != nil {
57 for k, v := range generic {
58 ik, err := strconv.ParseInt(k, 10, 32)
63 gr[GID(ik)] = GroupRelationType(v)
72 Name string // Full name
73 ShortName string // Abbreviated name
75 IRC string // irc: schema format
83 LastActivity time.Time
86 AnimeCount int // Number of anime this group has worked on
87 FileCount int // Number of files this group has released
89 RelatedGroups GroupRelations