correct modtime

This commit is contained in:
royalcat 2024-12-17 12:51:10 +03:00
parent 92bb67959b
commit 0ae11aa283
15 changed files with 107 additions and 85 deletions
daemons/qbittorrent

View file

@ -160,6 +160,11 @@ func (fs *Daemon) GetTorrentFS(ctx context.Context, sourcePath string, file vfs.
ctx, span := trace.Start(ctx, "GetTorrentFS")
defer span.End()
stat, err := file.Info()
if err != nil {
return nil, err
}
log := fs.log.With(slog.String("file", file.Name()))
ih, err := readInfoHash(ctx, file)
@ -185,7 +190,7 @@ func (fs *Daemon) GetTorrentFS(ctx context.Context, sourcePath string, file vfs.
fs.sourceFiles[sourcePath] = ih.HexString()
fs.sourceFilesMu.Unlock()
return newTorrentFS(ctx, fs.ur, fs.client, file.Name(), ih.HexString(), torrentPath)
return newTorrentFS(ctx, fs.client, file.Name(), ih.HexString(), stat.ModTime(), torrentPath)
}
func (d *Daemon) syncTorrentState(ctx context.Context, file vfs.File, ih metainfo.Hash, torrentPath string) error {