@@ -85,7 +85,7 @@ app.get('/images', (req, res) => {
8585 pattern = '*'
8686 }
8787
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 } )
8989
9090 images = files . map ( file => {
9191 // Expected filename example:
@@ -130,7 +130,7 @@ app.get('/images', (req, res) => {
130130 extraPattern = "." + ext
131131 }
132132
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 } )
134134
135135 images = files . map ( file => {
136136 // Expected filename example:
@@ -150,7 +150,10 @@ app.get('/images', (req, res) => {
150150 let weight = noext . match ( / { (?: [ 0 - 9 ] * \. ? [ 0 - 9 ] + \s ? - ) ? ( [ 0 - 9 ] * \. ? [ 0 - 9 ] + ) } / )
151151 weight = weight ? weight [ 1 ] : "1.0"
152152
153+ // Find keywords in []
153154 let keywords = filename . match ( / \[ ( .* ) \] / )
155+
156+ // Replace placeholders, escape (), remove [].
154157 if ( keywords ) {
155158 keywords = keywords [ 1 ]
156159 keywords = keywords . replaceAll ( / © ️ / g, ':' )
@@ -214,7 +217,7 @@ app.get('/moreImages', (req, res) => {
214217
215218 const query = `networks/${ searchPath } /${ noext } (.*|).${ imgExt } `
216219 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 } )
218221
219222 const images = files . map ( file => {
220223 const path = file . path . replace ( file . name , '' ) . replace ( 'networks/' , '' ) . toLowerCase ( )
0 commit comments