mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-03-30 02:25:00 +00:00
feat: use origin task size and seconds
This commit is contained in:
@@ -92,6 +92,25 @@ func RelayTaskSubmit(c *gin.Context, info *relaycommon.RelayInfo) (taskErr *dto.
|
|||||||
platform = originTask.Platform
|
platform = originTask.Platform
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 使用原始任务的参数
|
||||||
|
if info.Action == "remix" {
|
||||||
|
var taskData map[string]interface{}
|
||||||
|
_ = json.Unmarshal(originTask.Data, &taskData)
|
||||||
|
secondsStr, _ := taskData["seconds"].(string)
|
||||||
|
seconds, _ := strconv.Atoi(secondsStr)
|
||||||
|
if seconds <= 0 {
|
||||||
|
seconds = 4
|
||||||
|
}
|
||||||
|
sizeStr, _ := taskData["size"].(string)
|
||||||
|
if info.PriceData.OtherRatios == nil {
|
||||||
|
info.PriceData.OtherRatios = map[string]float64{}
|
||||||
|
}
|
||||||
|
info.PriceData.OtherRatios["seconds"] = float64(seconds)
|
||||||
|
info.PriceData.OtherRatios["size"] = 1
|
||||||
|
if sizeStr == "1792x1024" || sizeStr == "1024x1792" {
|
||||||
|
info.PriceData.OtherRatios["size"] = 1.666667
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if platform == "" {
|
if platform == "" {
|
||||||
platform = GetTaskPlatform(c)
|
platform = GetTaskPlatform(c)
|
||||||
|
|||||||
Reference in New Issue
Block a user