• 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.

folder monitor/ file creation...

Scheduled Pinned Locked Moved Requests
10 Posts 2 Posters 961 Views 3 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.
  • S Offline
    sdetweil @banbutcher
    last edited by Apr 13, 2020, 11:00 AM

    @banbutcher said in folder monitor/ file creation...:

      if(this.dataFile){
      	wrapper.innerHTML = this.dataFile;
      } else {
      	wrapper.innerHTML = "No data";
      }
    

    if the content you are injecting in NOT html, then you should use innerText…
    it might recognize the line ends as such… they are not line ends in html

    if the innerText doesn’t work, then u will have to convert the line ends t html line breaks
    replace '\n\ with ‘
    ’

    note that html is NOT UTF 8

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    1 Reply Last reply Reply Quote 0
    • B Offline
      banbutcher
      last edited by Apr 13, 2020, 11:18 AM

      here is the script that im using to retreve file names…

      #!/bin/bash
      
      TARGET=/media/TheVault/UnWatched/
      PROCESSED=/media/TheVault/Torrentopia/Torrent-Files/
      
      inotifywait -m -e create -e moved_to -r --format "%f" $TARGET \
              | while read FILENAME
                      do
                              echo Detected $FILENAME, Adding to list...
                              echo $FILENAME | cat - $PROCESSED/new-tv-list.txt > temp && mv temp $PROCESSED/new-tv-list.txt
      #                        echo $FILENAME `date` >> $PROCESSED/new-tv-list.txt
      			cp $PROCESSED/new-tv-list.txt /home/pi/MagicMirror/new-tv-list.txt
      
                      done
      

      if i take out the utf8 part i get an [object array buffer] instead of my file names…

      B S 2 Replies Last reply Apr 13, 2020, 11:26 AM Reply Quote 0
      • B Offline
        banbutcher @banbutcher
        last edited by banbutcher Apr 13, 2020, 11:28 AM Apr 13, 2020, 11:26 AM

        @banbutcher

        so i put back in the utf8 and then added <br> after i echo the filename and now its working fine now, i need to tweek it more to suit my needs but so far so good! thanks for your help @sdetweil im sure ill be asking more silly questions again soon! :)

        S 1 Reply Last reply Apr 13, 2020, 11:29 AM Reply Quote 0
        • S Offline
          sdetweil @banbutcher
          last edited by Apr 13, 2020, 11:29 AM

          @banbutcher said in folder monitor/ file creation...:

          ill be asking more silly questions

          no such thing… ask away…

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 1
          • S Offline
            sdetweil @banbutcher
            last edited by Apr 13, 2020, 11:31 AM

            @banbutcher you can also convert the buffer to a string

            buffer_object.toString()

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            1 / 1
            • First post
              10/10
              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