🐛 Fix check reupload condition

This commit is contained in:
LittleSheep 2024-11-10 00:59:20 +08:00
parent 6cda5751df
commit d0927b5528

View File

@ -95,7 +95,7 @@ func CheckChunkExistsInTemporary(meta models.Attachment, cid string) bool {
} }
func ReUploadFileToPermanent(meta models.Attachment, dst int) error { func ReUploadFileToPermanent(meta models.Attachment, dst int) error {
if dst == models.AttachmentDstTemporary || meta.Destination != dst { if dst == models.AttachmentDstTemporary || meta.Destination == dst {
return fmt.Errorf("destnation cannot be reversed temporary or the same as the original") return fmt.Errorf("destnation cannot be reversed temporary or the same as the original")
} }
if meta.Destination != models.AttachmentDstTemporary { if meta.Destination != models.AttachmentDstTemporary {