修复: 文件预览误报脏标记与编辑丢失等一批缺陷
- 脏标记行尾归一(含裸\r),CRLF 文件打开不再误报未保存 - 防抖回灌校验发起文件+flushEmit,杜绝串文件与丢尾 - F5/tab淘汰/读失败/草稿/重命名/保存刷新六处状态一致性修复 - GBK 文件按原编码回写(接口零改动),保存不再悄悄转 UTF-8 - .sh 系高亮根修(StreamLanguage 导入源错),面包屑长名截断 - CSV 大文件门豁免+表头贴顶;空标题滤除与 iframe 边距去除 - BGM 播放器增强收编(拖拽seek/音量/连播/快捷键/路径导航折叠) - 版本 0.5.3,CHANGELOG 同步
This commit is contained in:
1 parent
e5e8054916
commit
bce14a0480
26 files changed
+1010
-138
No files matched your search
@@ -269,16 +269,20 @@ func (s *Service) RenamePath(connID string, oldPath, newPath string) (*filesyste
|
||||
|
||||
// DownloadToTemp 下载远程文件到本地临时目录(带 SQLite 缓存)
|
||||
func (s *Service) DownloadToTemp(connID string, remotePath string) (string, error) {
|
||||
// 先获取文件元信息用于缓存键,确保远程文件变更时能淘汰旧缓存
|
||||
// 先获取文件元信息用于缓存键,确保远程文件变更时能淘汰旧缓存。
|
||||
// 元信息获取失败时禁用缓存直接下载:退化为 (path,0,"") 无指纹键会让该路径
|
||||
// 永远命中第一次的旧缓存(陈旧内容且刷新无效)
|
||||
var fileSize int64
|
||||
var modTime string
|
||||
if info, err := s.GetFileInfo(connID, remotePath); err == nil {
|
||||
if sz, ok := info["size"].(int64); ok {
|
||||
fileSize = sz
|
||||
}
|
||||
if mt, ok := info["mod_time"].(string); ok {
|
||||
modTime = mt
|
||||
}
|
||||
info, err := s.GetFileInfo(connID, remotePath)
|
||||
if err != nil {
|
||||
return s.downloadToTempDirect(connID, remotePath)
|
||||
}
|
||||
if sz, ok := info["size"].(int64); ok {
|
||||
fileSize = sz
|
||||
}
|
||||
if mt, ok := info["mod_time"].(string); ok {
|
||||
modTime = mt
|
||||
}
|
||||
return storage.DownloadToTempCached("sftp", connID, remotePath, fileSize, modTime, func() (string, error) {
|
||||
return s.downloadToTempDirect(connID, remotePath)
|
||||
|
||||
Reference in new issue
Block a user