Author Topic: Change the playcount of a song in a plugin  (Read 5058 times)

EricPrescott

  • Newbie
  • *
  • Posts: 8
Hi everyone,

   I trying to change the playcount of a song inside a plugin but I can't seem to figure out how to do it.

  The musicBeeApiInterface doesn't seem to have a delegate for that

  There is one to get the playcount:
Library_GetFileProperty


http://getmusicbee.com/forum/index.php?topic=11442.0

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
yes you can update it

Library_SetFileTag
Library_CommitTagsToFile

MB_RefreshPanels to update the GUI but this is slow and shouldnt be called too often if you are batch updating
Last Edit: May 18, 2014, 08:58:22 PM by Steven

boroda

  • Sr. Member
  • ****
  • Posts: 4595
Use type casting of FileProperty with Library_SetFileTag

EricPrescott

  • Newbie
  • *
  • Posts: 8
Oh, I didn't eve noticed that that message got sent. It was obviously not finished but you answered my question so thanks a lot!

So here is was it looks like:

this.MbApiInterface.Library_SetFileTag(fileUrl, (Plugin.MetaDataType)Plugin.FilePropertyType.PlayCount, value.ToString());
this.MbApiInterface.Library_CommitTagsToFile(fileUrl);

Thanks again.