refactor(thumb): thumb logic for slave policy

This commit is contained in:
Aaron Liu
2023-04-07 19:25:29 +08:00
parent ae118c337e
commit 7cb5e68b78
15 changed files with 75 additions and 78 deletions

View File

@@ -464,10 +464,5 @@ 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 {
switch file.GetPolicy().Type {
case "local":
return file.MetadataSerialized[ThumbStatusMetadataKey] != ThumbStatusNotAvailable
default:
return file.PicInfo != "" && file.PicInfo != " " && file.PicInfo != "null,null"
}
return file.MetadataSerialized[ThumbStatusMetadataKey] != ThumbStatusNotAvailable
}