cleaned up anilist struct and function
This commit is contained in:
		@@ -355,43 +355,10 @@ func (a *App) GetAniListUserWatchingList(page int, perPage int, sort string) Ani
 | 
				
			|||||||
	return post
 | 
						return post
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (a *App) AniListUpdateEntry(
 | 
					func (a *App) AniListUpdateEntry(updateBody AniListUpdateVariables) interface{} {
 | 
				
			||||||
	mediaId int,
 | 
					 | 
				
			||||||
	progress int,
 | 
					 | 
				
			||||||
	status string,
 | 
					 | 
				
			||||||
	score float64,
 | 
					 | 
				
			||||||
	repeat int,
 | 
					 | 
				
			||||||
	notes string,
 | 
					 | 
				
			||||||
	startYear int,
 | 
					 | 
				
			||||||
	startMonth int,
 | 
					 | 
				
			||||||
	startDay int,
 | 
					 | 
				
			||||||
	completeYear int,
 | 
					 | 
				
			||||||
	completeMonth int,
 | 
					 | 
				
			||||||
	completeDay int,
 | 
					 | 
				
			||||||
) interface{} {
 | 
					 | 
				
			||||||
	type StartedAt struct {
 | 
					 | 
				
			||||||
		Year  int `json:"year"`
 | 
					 | 
				
			||||||
		Month int `json:"month"`
 | 
					 | 
				
			||||||
		Day   int `json:"day"`
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	type CompletedAt struct {
 | 
					 | 
				
			||||||
		Year  int `json:"year"`
 | 
					 | 
				
			||||||
		Month int `json:"month"`
 | 
					 | 
				
			||||||
		Day   int `json:"day"`
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	type Variables struct {
 | 
					 | 
				
			||||||
		MediaId     int         `json:"mediaId"`
 | 
					 | 
				
			||||||
		Progress    int         `json:"progress"`
 | 
					 | 
				
			||||||
		Status      string      `json:"status"`
 | 
					 | 
				
			||||||
		Score       float64     `json:"score"`
 | 
					 | 
				
			||||||
		Repeat      int         `json:"repeat"`
 | 
					 | 
				
			||||||
		Notes       string      `json:"notes"`
 | 
					 | 
				
			||||||
		StartedAt   StartedAt   `json:"startedAt"`
 | 
					 | 
				
			||||||
		CompletedAt CompletedAt `json:"completedAt"`
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	body := struct {
 | 
						body := struct {
 | 
				
			||||||
		Query     string                 `json:"query"`
 | 
							Query     string                 `json:"query"`
 | 
				
			||||||
		Variables Variables `json:"variables"`
 | 
							Variables AniListUpdateVariables `json:"variables"`
 | 
				
			||||||
	}{
 | 
						}{
 | 
				
			||||||
		Query: `
 | 
							Query: `
 | 
				
			||||||
			mutation(
 | 
								mutation(
 | 
				
			||||||
@@ -433,24 +400,8 @@ func (a *App) AniListUpdateEntry(
 | 
				
			|||||||
			  }
 | 
								  }
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		`,
 | 
							`,
 | 
				
			||||||
		Variables: Variables{
 | 
							Variables: updateBody,
 | 
				
			||||||
			MediaId:  mediaId,
 | 
						}
 | 
				
			||||||
			Progress: progress,
 | 
					 | 
				
			||||||
			Status:   status,
 | 
					 | 
				
			||||||
			Score:    score,
 | 
					 | 
				
			||||||
			Repeat:   repeat,
 | 
					 | 
				
			||||||
			Notes:    notes,
 | 
					 | 
				
			||||||
			StartedAt: StartedAt{
 | 
					 | 
				
			||||||
				Year:  startYear,
 | 
					 | 
				
			||||||
				Month: startMonth,
 | 
					 | 
				
			||||||
				Day:   startDay,
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			CompletedAt: CompletedAt{
 | 
					 | 
				
			||||||
				Year:  completeYear,
 | 
					 | 
				
			||||||
				Month: completeMonth,
 | 
					 | 
				
			||||||
				Day:   completeDay,
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
		}}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	returnedBody, _ := AniListQuery(body, true)
 | 
						returnedBody, _ := AniListQuery(body, true)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -112,6 +112,27 @@ type MediaList struct {
 | 
				
			|||||||
	} `json:"user"`
 | 
						} `json:"user"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type StartedAt struct {
 | 
				
			||||||
 | 
						Year  int `json:"year"`
 | 
				
			||||||
 | 
						Month int `json:"month"`
 | 
				
			||||||
 | 
						Day   int `json:"day"`
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					type CompletedAt struct {
 | 
				
			||||||
 | 
						Year  int `json:"year"`
 | 
				
			||||||
 | 
						Month int `json:"month"`
 | 
				
			||||||
 | 
						Day   int `json:"day"`
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					type AniListUpdateVariables struct {
 | 
				
			||||||
 | 
						MediaId     int         `json:"mediaId"`
 | 
				
			||||||
 | 
						Progress    int         `json:"progress"`
 | 
				
			||||||
 | 
						Status      string      `json:"status"`
 | 
				
			||||||
 | 
						Score       float64     `json:"score"`
 | 
				
			||||||
 | 
						Repeat      int         `json:"repeat"`
 | 
				
			||||||
 | 
						Notes       string      `json:"notes"`
 | 
				
			||||||
 | 
						StartedAt   StartedAt   `json:"startedAt"`
 | 
				
			||||||
 | 
						CompletedAt CompletedAt `json:"completedAt"`
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//var MediaListSort = struct {
 | 
					//var MediaListSort = struct {
 | 
				
			||||||
//	MediaId               string
 | 
					//	MediaId               string
 | 
				
			||||||
//	MediaIdDesc           string
 | 
					//	MediaIdDesc           string
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user