sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
16.72k stars 389 forks source link

cache_dir not working #1919

Open Xygyl opened 3 days ago

Xygyl commented 3 days ago

What system are you running Yazi on?

Linux X11

What terminal are you running Yazi in?

kitty v0.36.4

yazi --debug output

Yazi
    Version: 0.3.3 (af565fb 2024-11-18)
    Debug  : false
    Triple : x86_64-unknown-linux-gnu (linux-x86_64)
    Rustc  : 1.82.0 (f6e511ee 2024-10-15)

Ya
    Version: 0.3.3 (VERGEN_IDEMPOTENT_OUTPUT 2024-10-09)

Emulator
    Emulator.via_env: ("xterm-kitty", "")
    Emulator.via_csi: Ok(Kitty)
    Emulator.detect : Kitty

Adapter
    Adapter.matches: Kgp

Desktop
    XDG_SESSION_TYPE           : Some("tty")
    WAYLAND_DISPLAY            : None
    DISPLAY                    : Some(":0")
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: None
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL           : Some("/bin/nu")
    EDITOR          : Some("/usr/bin/hx")
    VISUAL          : None
    YAZI_FILE_ONE   : None
    YAZI_CONFIG_HOME: None
    YAZI_ZOXIDE_OPTS: None
    FZF_DEFAULT_OPTS: None

Text Opener
    default     : Some(Opener { run: "hx \"$@\"", block: true, orphan: false, desc: "hx", for_: None, spread: true })
    block-create: Some(Opener { run: "hx \"$@\"", block: true, orphan: false, desc: "hx", for_: None, spread: true })
    block-rename: Some(Opener { run: "hx \"$@\"", block: true, orphan: false, desc: "hx", for_: None, spread: true })

Multiplexers
    TMUX               : false
    tmux version       : No such file or directory (os error 2)
    tmux build flags   : enable-sixel=Unknown
    ZELLIJ_SESSION_NAME: None
    Zellij version     : No such file or directory (os error 2)

Dependencies
    file             : 5.45
    ueberzugpp       : No such file or directory (os error 2)
    ffmpegthumbnailer: 2.2.2
    pdftoppm         : 24.08.0
    magick           : 7.1.1-38
    fzf              : 0.55.0
    fd               : 10.2.0
    fdfind           : No such file or directory (os error 2)
    rg               : 14.1.1
    chafa            : No such file or directory (os error 2)
    zoxide           : 0.9.6
    7z               : No such file or directory (os error 2)
    7zz              : 24.08
    jq               : No such file or directory (os error 2)

Clipboard
    wl-copy/paste: 2.2.1 / 2.2.1
    xclip        : No such file or directory (os error 2)
    xsel         : No such file or directory (os error 2)

--------------------------------------------------

Describe the bug

I have three drives in my system: my root drive, a hard drive, and an ssd. I have set the cache_dir to a directory on my ssd and when I load images on my hard drive they show up in that directory, so I know that it's working correctly. However, when I reboot, the cached images remain but when I load their counterparts on my hard drive it's as if they were never cached.

Minimal reproducer

Due to the nature of this issue, I'm not sure what to put here. I suppose you could reproduce the issue if you have a setup similar to mine: the media being on one drive and the cache_dir on another, with neither of them being the root drive.

Anything else?

No response

Validations

sxyazi commented 3 days ago

I can't reproduce it.

Yazi uses file's path and mtime as the unique id for caching:

https://github.com/sxyazi/yazi/blob/6a4f6aa99f1c9422af68b8f5ea93082e84c12a9a/yazi-plugin/src/utils/cache.rs#L16-L22

Are you sure the mtime of your files hasn't changed?