mAirListScript.chm Errors?

It seems that the IPlaylistItem Methods in the Scripting Help file no longer contains SaveMMD or SaveTags as valid methods?

[later]

Oh, wait! I just found SaveMMD lurking in IFilePlaylistItem. But where has SaveTags gone?

And while I think about it, is there a corresponding SaveDatabase method or not? If not, how does one script the equivalent of clicking Save Database in an Item’s Properties dialog?

[later STILL]

Ah. Is that what IDatabase.SavePlaylistItem is for? In which case, one would presumably write code like:

IDatabase.SavePlaylistItem(CurrentPlaylist.GetItem(0));
Right or wrong? ???

Thanks in advance.

BFN
CAD

Take a look at the IFileTypeHandler interface and its WriteTags interface, which can be accessed through IFilePlaylistItem.GetFileTypeHandler.

I can re-add the WriteTags method as a shortcut if you think that would be useful. The same for SaveToDatabase - the solution you found is exactly the way to do it (pass the item to the database’s SavePlaylistItem method for saving).

Regarding IFilePlaylistItem vs. IPlaylistItem - the tags and MMD functions only make sense for files (and are only implemented for files of course). I could pull the methods up to IFilePlaylistItem, but that would mean that you could accidently call them for other items as well, which would result in an error.

The best and safest way at the time being is to check the type of the item first, skip it if it is not a file, or typecast it to IFilePlaylistItem otherwise, then working with the typecasted reference.

Belated reply!

Yes, WriteTags and the associated code does work, but not when the Item is already loaded into a Player. In that case, I get the message The file cannot be accessed because it is being accessed by another process.

This is also true for the Write Tag button in the PFL Player.

And this is in Build 764 of v3.1.1.

Is this what you would expect? If so, it does limit the possibility for automatically updating the Tags of Items in a Playlist. :frowning: If not, I think it might be a bug.

BFN
CAD