• Agents only update the first file

    By Paulo S Branco 2 decades ago



    Hi Phillip,





    You have built excellent application which I will start use as soon as possible. I was looking for something like this for ages, and I was almost building my own. Although there is a little bug on the agents (change_…) The line which read the file should be inside of the loop, so it will allow us to change multiple files at one shot. Right now it updating only the first one.


           ID3v1Tag id;<br/>
               Document doc = dc.getFirstDocument();<br/>
              //File f = new File(doc.getItemValueString(&quot;FilePath&quot;));//&lt;&lt; line not necessary<br/>
               while(doc != null){<br/>
      File f = new File(doc.getItemValueString(&quot;FilePath&quot;));//&lt;&lt; This line should be here<br/>
                 id  = new ID3v1Tag(f);<br/>
                 id.copyArtistFromEnvironment(session);<br/>
              doc.replaceItemValue(&quot;Artist&quot;, session.getEnvironmentString(&quot;Artist&quot;));<br/>
              doc.save(true, false);<br/>
    





    Thanks a lot again

    • Good catch.

      By Phillip A Kahrl 2 decades ago

      Thanks, I haven't looked at this code in years - I think this was actually my first Java app. If you feel comfortable with your change, mail me a .nsf with the change and I'll post it as a new release.



      Glad you like the product.