Skip to content

Commit

Permalink
Add recurseLocalDirectories config item
Browse files Browse the repository at this point in the history
  • Loading branch information
kolbyjack committed Feb 5, 2023
1 parent 89ec205 commit 26bbb89
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@ http:// or https:// url:

|Option|Default|Description|
|---|---|---|
|`"addCacheBuster"`|true|Whether to add a cache-busting argument to the query string (`mmm-wallpaper-ts`).|
|`"addCacheBuster"`|`true`|Whether to add a cache-busting argument to the query string (`mmm-wallpaper-ts`).|

local:

|Option|Default|Description|
|---|---|---|
|`"recurseLocalDirectories"`|`false`|Whether to recurse into subdirectories when looking for images.|

## Notifications

Expand Down
4 changes: 2 additions & 2 deletions node_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ module.exports = NodeHelper.create({

for (const dirent of dirents) {
const entpath = path.resolve(dir, dirent.name);
if (dirent.isDirectory()) {
if (dirent.isDirectory() && config.recurseLocalDirectories) {
result = result.concat(await getFiles(entpath, `${prefix}${dirent.name}/`));
} else if (dirent.name.toLowerCase().match(fileMatcher) != null) {
} else if (dirent.isFile() && dirent.name.toLowerCase().match(fileMatcher) != null) {
result.push({
url: `${urlPath}${prefix.substring(1)}${dirent.name}`,
caption: entpath,
Expand Down

0 comments on commit 26bbb89

Please sign in to comment.