mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Allow path separator in scene filename parser pattern (#327)
* Allow path in filename parser
* Fix helper text re escaping {} characters
This commit is contained in:
@@ -335,9 +335,15 @@ func (h *sceneHolder) postParse() {
|
||||
}
|
||||
|
||||
func (m parseMapper) parse(scene *models.Scene) *sceneHolder {
|
||||
// perform matching on basename
|
||||
// TODO - may want to handle full path at some point
|
||||
|
||||
// #302 - if the pattern includes a path separator, then include the entire
|
||||
// scene path in the match. Otherwise, use the default behaviour of just
|
||||
// the file's basename
|
||||
// must be double \ because of the regex escaping
|
||||
filename := filepath.Base(scene.Path)
|
||||
if strings.Contains(m.regexString, `\\`) || strings.Contains(m.regexString, "/") {
|
||||
filename = scene.Path
|
||||
}
|
||||
|
||||
result := m.regex.FindStringSubmatch(filename)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user