kolbyjack / MMM-Wallpaper

MagicMirror module to display wallpapers from various online sources
https://magicmirror.builders/
MIT License
99 stars 31 forks source link

Not a issue; "local:</path/to/directory>" #73

Closed estradanet closed 1 year ago

estradanet commented 2 years ago

Is it possible to include the "local:</path/to/directory>" and it's subfolders? If so, how is that possible?

it would be nice to be able to organize the files in different folders (by year, for example)

kolbyjack commented 2 years ago

Can you try the recurse-local-directories branch?

DocKDE commented 1 year ago

I'd love this feature as well. I tried the branch you created but MagicMirror won't start with it enabled. It shows a can't find request module error. I suppose it's too far behind master by now. I tried rebasing it on master but although MM starts after doing that, no images are shown anymore. If someone could take a look at this, I'd be willing to test.

kolbyjack commented 1 year ago

Give the branch another try now, I just pushed a fix

DocKDE commented 1 year ago

Awesome, thanks for the quick update! I gave it a try and it seems to work pretty much as expected. However, I noticed duplicate pictures to keep appearing. I have my pictures (some 2000 or so) mounted to my Raspi via webdav, the updateInterval is 86400000 and the maximumEntries is set to 1000. If I understood correctly, this should mean that I could only be seeing the same picture twice after a day at the soonest or am I missing something here? Possibly it has to do with me only restarting the browser and not MagicMirror itself after changing settings?

Side note: it might be a good idea to make the directory recursion an option in the config. Thanks again for your work!

kolbyjack commented 1 year ago

With maximumEntries set to 1000, it will take ~16:40 to cycle through all of the images, so you will see duplicates within a day in the morning and the evening. If you're noticing them more often than that, it would be a bug, but I'm not sure why it would be happening, the code to cycle through the images once they're chosen is pretty simple.

kolbyjack commented 1 year ago

I've also merged the changes into the master branch, and recursing is controlled by the recurseLocalDirectories config item (default false). I just didn't feel like it was necessary to add the config flag in the feature branch since it was specifically for testing that functionality.

DocKDE commented 1 year ago

Awesome, thanks! Completely agree, a dedicated config isn't needed in a testing branch.

I suppose the duplicate pictures are due to me restarting the browser which probably resets the queue.

kolbyjack commented 1 year ago

Yeah, that's probably it. node_helper caches its response so if you restart the browser, it's likely starting over again from the beginning of whatever shuffled list that was there. I could probably add a cached timestamp to the response, so if you restart the browser, it could pick up in the cached list where it left off before, instead of starting over. I'll add that to my list of ideas to implement when I find time