darickc / MMM-BackgroundSlideshow

MIT License
135 stars 78 forks source link

Name of the image without file extension #106

Closed MacG-DD closed 2 years ago

MacG-DD commented 2 years ago

The name of the image also shows the file extension.

Could you please remove it or use the title from the EXIF data?

MacG-DD commented 2 years ago

Here is my solution way. I added the following after line 101 of MMM-BackgroundSlideshow.js

// remove the file extension from image name
showNoFileExtension: false

as config variable and after line 617 the function

// Remove file extension from image name. if (this.config.showNoFileExtension) { imageName = imageName.split('.')[0]; }

Then you have to add follows to the config.js

showNoFileExtension: true

Edit: a small adjustment and improvement

MacG-DD commented 2 years ago

Add the function in the current version after line 634 or better above the line with

imageProps.push(imageName);

@darickc Maybe someone can make a branch or master out of it. This is beyond my capabilities.

cweinhofer commented 2 years ago

Thanks @MacG-DD ! This was exactly what I was looking for, especially since gpetersen/MMM-BackgroundSlideshowInfo has stopped working for me.

I created the pull request to merge this into the main code.

PS - I changed the function name from showNoFileExtension to imageInfoNoFileExt just to better match the related config options.