mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Add oshash support (#667)
This commit is contained in:
@@ -34,6 +34,32 @@ exclude:
|
||||
|
||||
_a useful [link](https://regex101.com/) to experiment with regexps_
|
||||
|
||||
## Hashing algorithms
|
||||
|
||||
Stash identifies video files by calculating a hash of the file. There are two algorithms available for hashing: `oshash` and `MD5`. `MD5` requires reading the entire file, and can therefore be slow, particularly when reading files over a network. `oshash` (which uses OpenSubtitle's hashing algorithm) only reads 64k from each end of the file.
|
||||
|
||||
The hash is used to name the generated files such as preview images and videos, and sprite images.
|
||||
|
||||
By default, new systems have MD5 calculation disabled for optimal performance. Existing systems that are upgraded will have the oshash populated for each scene on the next scan.
|
||||
|
||||
### Changing the hashing algorithm
|
||||
|
||||
To change the file naming hash to oshash, all scenes must have their oshash values populated. oshash population is done automatically when scanning.
|
||||
|
||||
To change the file naming hash to `MD5`, the MD5 must be populated for all scenes. To do this, `Calculate MD5` for videos must be enabled and the library must be rescanned.
|
||||
|
||||
MD5 calculation may only be disabled if the file naming hash is set to `oshash`.
|
||||
|
||||
After changing the file naming hash, any existing generated files will now be named incorrectly. This means that stash will not find them and may regenerate them if the `Generate task` is used. To remedy this, run the `Rename generated files` task, which will rename existing generated files to their correct names.
|
||||
|
||||
#### Step-by-step instructions to migrate to oshash for existing users
|
||||
|
||||
These instructions are for existing users whose systems will be defaulted to use and calculate MD5 checksums. Once completed, MD5 checksums will no longer be calculated when scanning, and oshash will be used for generated file naming. Existing calculated MD5 checksums will remain on scenes, but checksums will not be calculated for new scenes.
|
||||
|
||||
1. Scan the library (to populate oshash for all existing scenes).
|
||||
2. In Settings -> Configuration page, untick `Calculate MD5` and select `oshash` as file naming hash. Save the configuration.
|
||||
3. In Settings -> Tasks page, click on the `Rename generated files` migration button.
|
||||
|
||||
## Scraping
|
||||
|
||||
### User Agent string
|
||||
|
||||
Reference in New Issue
Block a user