mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 16:34:02 +01:00
Folder Gallery creation on a per folder basis (#3715)
* GalleryInExClusion // Create Gallery from folder based on file, short description in setting * GalleryInExClusion // No Folderiteration, expansion of docs * GalleryInExClusion // Only accept lowercase files * GalleryInExClusion // Correct text in settings
This commit is contained in:
parent
61c0098ae6
commit
0069c48e7e
3 changed files with 31 additions and 3 deletions
|
|
@ -307,7 +307,23 @@ func (h *ScanHandler) getOrCreateGallery(ctx context.Context, f file.File) (*mod
|
||||||
return h.getOrCreateZipBasedGallery(ctx, f.Base().ZipFile)
|
return h.getOrCreateZipBasedGallery(ctx, f.Base().ZipFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
if h.ScanConfig.GetCreateGalleriesFromFolders() {
|
// Look for specific filename in Folder to find out if the Folder is marked to be handled differently as the setting
|
||||||
|
folderPath := filepath.Dir(f.Base().Path)
|
||||||
|
|
||||||
|
forceGallery := false
|
||||||
|
if _, err := os.Stat(filepath.Join(folderPath, ".forcegallery")); err == nil {
|
||||||
|
forceGallery = true
|
||||||
|
} else if !errors.Is(err, os.ErrNotExist) {
|
||||||
|
return nil, fmt.Errorf("Could not test Path %s: %w", folderPath, err)
|
||||||
|
}
|
||||||
|
exemptGallery := false
|
||||||
|
if _, err := os.Stat(filepath.Join(folderPath, ".nogallery")); err == nil {
|
||||||
|
exemptGallery = true
|
||||||
|
} else if !errors.Is(err, os.ErrNotExist) {
|
||||||
|
return nil, fmt.Errorf("Could not test Path %s: %w", folderPath, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if forceGallery || (h.ScanConfig.GetCreateGalleriesFromFolders() && !exemptGallery) {
|
||||||
return h.getOrCreateFolderBasedGallery(ctx, f)
|
return h.getOrCreateFolderBasedGallery(ctx, f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,18 @@ exclude:
|
||||||
|
|
||||||
_a useful [link](https://regex101.com/) to experiment with regexps_
|
_a useful [link](https://regex101.com/) to experiment with regexps_
|
||||||
|
|
||||||
|
## Gallery Creation from Folders
|
||||||
|
|
||||||
|
In the Library section you can find an option to create a gallery from each folder containing images. This will be applied on all libraries when activated, including the base folder of a library.
|
||||||
|
|
||||||
|
If you wish to apply this on a per folder basis, you can create a file called **.nogallery** or **.forcegallery** in a folder that should act different than this global setting.
|
||||||
|
|
||||||
|
This will either exclude the folder from becoming a gallery even if the setting is set, or create a gallery from the folder even if the setting is not set.
|
||||||
|
|
||||||
|
The file will only be recognized if written in lower case letters.
|
||||||
|
|
||||||
|
Files with a dot in front are handled as hidden in the Linux OS and Mac OS, so you will not see those files after creation on your system without setting your file manager accordingly.
|
||||||
|
|
||||||
## Hashing algorithms
|
## 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.
|
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.
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,7 @@
|
||||||
"check_for_insecure_certificates_desc": "Some sites use insecure ssl certificates. When unticked the scraper skips the insecure certificates check and allows scraping of those sites. If you get a certificate error when scraping untick this.",
|
"check_for_insecure_certificates_desc": "Some sites use insecure ssl certificates. When unticked the scraper skips the insecure certificates check and allows scraping of those sites. If you get a certificate error when scraping untick this.",
|
||||||
"chrome_cdp_path": "Chrome CDP path",
|
"chrome_cdp_path": "Chrome CDP path",
|
||||||
"chrome_cdp_path_desc": "File path to the Chrome executable, or a remote address (starting with http:// or https://, for example http://localhost:9222/json/version) to a Chrome instance.",
|
"chrome_cdp_path_desc": "File path to the Chrome executable, or a remote address (starting with http:// or https://, for example http://localhost:9222/json/version) to a Chrome instance.",
|
||||||
"create_galleries_from_folders_desc": "If true, creates galleries from folders containing images.",
|
"create_galleries_from_folders_desc": "If true, creates galleries from folders containing images by default. Create a File called .forcegallery or .nogallery in a folder to enforce/prevent this.",
|
||||||
"create_galleries_from_folders_label": "Create galleries from folders containing images",
|
"create_galleries_from_folders_label": "Create galleries from folders containing images",
|
||||||
"database": "Database",
|
"database": "Database",
|
||||||
"db_path_head": "Database Path",
|
"db_path_head": "Database Path",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue