Repository: AlistGo/alist (language: go)

Issue:
本地crypt加密的视频无法播放了
### Please make sure of the following things

- [x] I have read the [documentation](https://alist.nn.ci).
我已经阅读了[文档](https://alist.nn.ci)。

- [x] I'm sure there are no duplicate issues or discussions.
我确定没有重复的issue或讨论。

- [x] I'm sure it's due to `AList` and not something else(such as [Network](https://alist.nn.ci/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host) ,`Dependencies` or `Operational`).
我确定是`AList`的问题，而不是其他原因（例如[网络](https://alist.nn.ci/zh/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host)，`依赖`或`操作`）。

- [x] I'm sure this issue is not fixed in the latest version.
我确定这个问题在最新版本中没有被修复。


### AList Version / AList 版本

v3.42.0

### Driver used / 使用的存储驱动

crypt加密驱动

### Describe the bug / 问题描述

crypt加密视频无法播放，以前版本可以正常播放

### Reproduction / 复现链接

无法播放

### Config / 配置

没有

### Logs / 日志

_No response_


Discussion / hints:
对对对，确认本地crypt播放视频有问题

Fix patch:
diff --git a/drivers/crypt/driver.go b/drivers/crypt/driver.go
index 59b25806ecf..2330fb9782b 100644
--- a/drivers/crypt/driver.go
+++ b/drivers/crypt/driver.go
@@ -282,8 +282,9 @@ func (d *Crypt) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (
 			if err != nil {
 				return nil, err
 			}
-			// 可以直接返回，读取完也不会调用Close，直到连接断开Close
-			return remoteLink.MFile, nil
+			//keep reuse same MFile and close at last.
+			remoteClosers.Add(remoteLink.MFile)
+			return io.NopCloser(remoteLink.MFile), nil
 		}
 
 		return nil, errs.NotSupport
diff --git a/server/common/proxy.go b/server/common/proxy.go
index 8519ed53c44..23360a346a4 100644
--- a/server/common/proxy.go
+++ b/server/common/proxy.go
@@ -7,6 +7,7 @@ import (
 	"net/http"
 	"net/url"
 	"os"
+	"strings"
 
 	"github.com/alist-org/alist/v3/internal/model"
 	"github.com/alist-org/alist/v3/internal/net"
@@ -102,11 +103,15 @@ func attachHeader(w http.ResponseWriter, file model.Obj) {
 	w.Header().Set("Etag", GetEtag(file))
 }
 func GetEtag(file model.Obj) string {
+	hash := ""
 	for _, v := range file.GetHash().Export() {
-		if len(v) != 0 {
-			return fmt.Sprintf(`"%s"`, v)
+		if strings.Compare(v, hash) > 0 {
+			hash = v
 		}
 	}
+	if len(hash) > 0 {
+		return fmt.Sprintf(`"%s"`, hash)
+	}
 	// 参考nginx
 	return fmt.Sprintf(`"%x-%x"`, file.ModTime().Unix(), file.GetSize())
 }


Test patch: