Closed web3nomad closed 1 month ago
spacedrive 现在应该只有 thumbnails
用到了 sharding
我先不改变目录结构,在 files
和 artifacts
文件夹里都加一下 sharding
当前:
├── artifacts
│ ├── 5adec370b6040f26
│ │ ├── audio.wav
│ │ ├── frames
│ │ │ ├── ...
│ │ ├── thumbnail.jpg
│ │ └── transcript.txt
├── files
│ ├── 5adec370b6040f26
│ └── ...
...
增加 sharding
后
├── artifacts
│ ├── 5ad
│ │ ├── 5adec370b6040f26
│ │ │ ├── audio.wav
│ │ │ ├── frames
│ │ │ │ ├── ...
│ │ │ ├── thumbnail.jpg
│ │ │ └── transcript.txt
├── files
│ ├── 5ad
│ │ ├── 5adec370b6040f26
│ │ └── ...
VideoHandler
加上 shardingapi-server
加上 shardingartifacts
类型分文件夹,然后文件夹内部加上 sharding
当前目录结构
spacedrive 生成 hash 的算法,看起来更快
https://github.com/spacedriveapp/spacedrive/blob/204c876689dc113713e63acf441a4a1281227a2d/core/src/object/cas.rs#L23
spacedrive 生成 shard 的方法,取 hash 的 0..3,作为子文件夹
https://github.com/spacedriveapp/spacedrive/blob/204c876689dc113713e63acf441a4a1281227a2d/core/src/object/media/old_thumbnail/shard.rs#L10