fix(Thumb): Don't generate / get thumb for file size equal to 0

This commit is contained in:
Sam 2023-08-14 12:53:50 +08:00 committed by GitHub
parent ce832bf13d
commit c60cdb1241
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -463,7 +463,7 @@ func (file *File) GetPosition() string {
// `True` does not guarantee the load request will success in next step, but the client
// should try to load and fallback to default placeholder in case error returned.
func (file *File) ShouldLoadThumb() bool {
return file.MetadataSerialized[ThumbStatusMetadataKey] != ThumbStatusNotAvailable
return file.MetadataSerialized[ThumbStatusMetadataKey] != ThumbStatusNotAvailable && file.Size != 0
}
// return sidecar thumb file name