HISE Logo Forum
    • Categories
    • Register
    • Login

    Server.downloadFile {extra parameter}

    Scheduled Pinned Locked Moved Feature Requests
    6 Posts 2 Posters 372 Views
    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.
    • ustkU
      ustk
      last edited by

      @Christoph-Hart Is it possible to use an extra parameter to the dowloadFile function this is passed to the callback?
      This would help a lot to keep track of what we're doing when downloading multiple things. This way we don't need recursion because we can find the source of the download using an index for instance.

      I have nothing against recursion, but when you want to use already downloaded files and download new ones it becomes messy because you don't know anymore what file is arriving.

      Having a parameter to pass in would make things so much easier...

      If doable I'll add it to the gigantomatic new roadmap 😇

      Can't help pressing F5 in the forum...

      1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart
        last edited by

        You can get almost every information from the this object inside the callback, can't you?

        ustkU 2 Replies Last reply Reply Quote 0
        • ustkU
          ustk @Christoph Hart
          last edited by

          @Christoph-Hart I only get this from trace(this.data)

          Interface: {
            "numTotal": 107277,
            "numDownloaded": 98304,
            "finished": true,
            "success": true
          }
          

          So no information about who instantiated the download

          Can't help pressing F5 in the forum...

          1 Reply Last reply Reply Quote 0
          • ustkU
            ustk @Christoph Hart
            last edited by ustk

            @Christoph-Hart I know it doesn't matter if you have only one file, but with an array, I'd like to pass the index since the callback is asynchronous. Recursion doesn't work in my edge case, because sometimes I download from the file array, sometimes the file already exists so the index changes before a file has a chance to arrive... so keeping track of the index isn't possible...
            Well, I can look for what file is existing first and divide my array, but this complicates the code where a parameter would make it easier...

            Can't help pressing F5 in the forum...

            1 Reply Last reply Reply Quote 0
            • Christoph HartC
              Christoph Hart
              last edited by

              Don't use this.data but the API functions here: https://docs.hise.audio/scripting/scripting-api/download/index.html

              eg. myURLList.indexOf(this.getFullURL())

              ustkU 1 Reply Last reply Reply Quote 1
              • ustkU
                ustk @Christoph Hart
                last edited by

                @Christoph-Hart Oh thanks! I'll have a look on sunday...

                Can't help pressing F5 in the forum...

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post

                37

                Online

                1.8k

                Users

                12.1k

                Topics

                105.1k

                Posts