Ejemplo n.º 1
0
func fileState(file *itchio.BuildFileInfo) string {
	theme := comm.GetTheme()

	fType := string(file.Type)
	if file.SubType != itchio.BuildFileSubType_DEFAULT {
		fType += fmt.Sprintf(" (%s)", file.SubType)
	}

	sign := theme.StatSign
	if file.State != itchio.BuildFileState_UPLOADED {
		sign = theme.OpSign
	}

	fSize := humanize.IBytes(uint64(file.Size))

	return fmt.Sprintf("%s %s %s", sign, fSize, fType)
}
Ejemplo n.º 2
0
func buildState(build *itchio.BuildInfo) string {
	theme := comm.GetTheme()
	var s string

	switch build.State {
	case itchio.BuildState_COMPLETED:
		s = fmt.Sprintf("%s #%d", theme.StatSign, build.ID)
	case itchio.BuildState_PROCESSING:
		s = fmt.Sprintf("%s #%d", theme.OpSign, build.ID)
	default:
		s = fmt.Sprintf("  #%d (%s)", build.ID, build.State)
	}

	if build.ParentBuildID != -1 {
		s += fmt.Sprintf(" (from #%d)", build.ParentBuildID)
	}

	return s
}