@@ -85,7 +85,7 @@ app.get('/images', (req, res) => {
85
85
pattern = '*'
86
86
}
87
87
88
- const files = fg . globSync ( [ `networks/${ searchType } /**/${ pattern } ${ extraPattern } ` ] , { onlyDirectories : _onlyDirectories , dot : true , caseSensitiveMatch : false , stats : true } )
88
+ const files = fg . globSync ( [ `networks/${ searchType } /**/${ pattern } ${ extraPattern } ` ] , { onlyDirectories : _onlyDirectories , dot : false , caseSensitiveMatch : false , stats : true } )
89
89
90
90
images = files . map ( file => {
91
91
// Expected filename example:
@@ -130,7 +130,7 @@ app.get('/images', (req, res) => {
130
130
extraPattern = "." + ext
131
131
}
132
132
133
- const files = fg . globSync ( [ `networks/${ searchType } /**/${ pattern } ${ extraPattern } ` ] , { dot : true , caseSensitiveMatch : false , stats : true } )
133
+ const files = fg . globSync ( [ `networks/${ searchType } /**/${ pattern } ${ extraPattern } ` ] , { dot : false , caseSensitiveMatch : false , stats : true } )
134
134
135
135
images = files . map ( file => {
136
136
// Expected filename example:
@@ -150,7 +150,10 @@ app.get('/images', (req, res) => {
150
150
let weight = noext . match ( / { (?: [ 0 - 9 ] * \. ? [ 0 - 9 ] + \s ? - ) ? ( [ 0 - 9 ] * \. ? [ 0 - 9 ] + ) } / )
151
151
weight = weight ? weight [ 1 ] : "1.0"
152
152
153
+ // Find keywords in []
153
154
let keywords = filename . match ( / \[ ( .* ) \] / )
155
+
156
+ // Replace placeholders, escape (), remove [].
154
157
if ( keywords ) {
155
158
keywords = keywords [ 1 ]
156
159
keywords = keywords . replaceAll ( / © ️ / g, ':' )
@@ -214,7 +217,7 @@ app.get('/moreImages', (req, res) => {
214
217
215
218
const query = `networks/${ searchPath } /${ noext } (.*|).${ imgExt } `
216
219
const queryFolder = `networks/${ searchPath } /${ noext } /*.${ imgExt } `
217
- const files = fg . globSync ( [ query , queryFolder ] , { dot : true , caseSensitiveMatch : false , stats : true } )
220
+ const files = fg . globSync ( [ query , queryFolder ] , { dot : false , caseSensitiveMatch : false , stats : true } )
218
221
219
222
const images = files . map ( file => {
220
223
const path = file . path . replace ( file . name , '' ) . replace ( 'networks/' , '' ) . toLowerCase ( )
0 commit comments