• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

MMM-ImagesPhotos - Show images from a directory

Scheduled Pinned Locked Moved Utilities
85 Posts 26 Posters 92.1k Views 26 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    broberg Project Sponsor @chassain 0
    last edited by Oct 23, 2019, 11:43 AM

    @chassain-0

    I don’t know if this works but

    	randomIndex: function(photos) {
    		if (photos.length === 1) {
    			return 0;
    		}
    
    		var generate = function() {
    			return Math.floor(Math.random() * photos.length);
    		};
    
    		var photoIndex = generate();
    		this.lastPhotoIndex = photoIndex;
    
    		return photoIndex;
    	},
    
    

    try to change return Math.floor(Math.random() * photos.length); to return Math.floor(photos.length);

    However it’s Just a guess

    S 1 Reply Last reply Oct 23, 2019, 12:12 PM Reply Quote 0
    • S Offline
      sdetweil @broberg
      last edited by Oct 23, 2019, 12:12 PM

      @broberg no. it needs more… need to USE the this.lastPhotoIndex, and check for over the end of the list,
      and reset the index when new list is loaded (even tho you didn’t get thru the list, as the module refreshes on a fixed time schedule (not calculated from number of images found)… I would add another config parm

      I have a fork of this module already, but have many local changes, so cannot make another.

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • C Offline
        chassain 0
        last edited by Oct 23, 2019, 1:54 PM

        Hello,

        I found this module : https://github.com/AdamMoses-GitHub/MMM-ImageSlideshow

        Maybe a solution. I m going to test this night

        1 Reply Last reply Reply Quote 0
        • K Offline
          KamiSchami
          last edited by Dec 31, 2020, 4:55 PM

          I would like to install it twice. If I just copy the folder and rename it, it won’t work anymore. Can somebody help me?

          Real programmers never work 9 to 5. If they are around at 9 AM, it's because they were up all night.

          1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil
            last edited by sdetweil Dec 31, 2020, 5:00 PM Dec 31, 2020, 4:58 PM

            u can try mine too
            https://github.com/sdetweil/MMM-ImagesPhotos

            to make images from a server the module/uploads folder needs to be replaced by a linked (ln command) to the server share folder

            ln -s server_share uploads

            I am very picky about how my images are displayed, no distortion allowed…
            I also support color or blurred image fill where the image does not cover the full screen

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • K Offline
              KamiSchami
              last edited by Dec 31, 2020, 7:09 PM

              ok, it has the same name. can I rename the module for myself, the folder?

              Real programmers never work 9 to 5. If they are around at 9 AM, it's because they were up all night.

              S 1 Reply Last reply Dec 31, 2020, 7:15 PM Reply Quote 0
              • S Offline
                sdetweil @KamiSchami
                last edited by sdetweil Dec 31, 2020, 7:15 PM Dec 31, 2020, 7:15 PM

                @KamiSchami rename the old folder, then git clone again from my repo, fixup any config parts, make link, or move link from old folder

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • K Offline
                  KamiSchami
                  last edited by Dec 31, 2020, 7:18 PM

                  🙈 ok, i will try it

                  Real programmers never work 9 to 5. If they are around at 9 AM, it's because they were up all night.

                  1 Reply Last reply Reply Quote 0
                  • 1
                  • 2
                  • 5
                  • 6
                  • 7
                  • 8
                  • 9
                  • 9 / 9
                  • First post
                    Last post
                  Enjoying MagicMirror? Please consider a donation!
                  MagicMirror created by Michael Teeuw.
                  Forum managed by Sam, technical setup by Karsten.
                  This forum is using NodeBB as its core | Contributors
                  Contact | Privacy Policy