INTERACT FORUM
Windows => Plug-in Development => Topic started by: robydago on February 26, 2008, 07:25:00 am
-
hi,
is it possible to overwrite play stats ("Last Played" and "Number Plays") fields using COM Media Center Automation?
thanks
-
* bump *
to be more clear (I hope):
once I get the MJFieldAutomation objects (http://wiki.jrmediacenter.com/index.php/MJFieldsAutomation#IMJFieldAutomation_.2A_GetField.28number_nField.29) corresponding to the "Last Played" and "Number Plays" fields, is it possible to write them?? (i.e. not just reading them)
thanks
-
I'm not sure, but try the MJFileAutomation function to set a field:
http://wiki.jrmediacenter.com/index.php/MJFileAutomation#boolean_Set.28string_strField.2C_string_strValue.29
j
-
THANKS!!!
This works using Mr ChriZ Scripting Plugin!!!
For y = 0 To MJFiles.GetNumberFiles() - 1
Dim MJFile as MediaCenter.IMJFileAutomation
MJFile = MJFiles.GetFile(y)
CurrentNumberPlays = MJFile.Get("Number Plays", 0)
NewNumberPlays = CurrentNumberPlays + NumberPlaysIncreaseValue
If CurrentNumberPlays <> NewNumberPlays then MJFile.Set("Number Plays", NewNumberPlays)
Next y
Now I have to work on Last Played but with dates it's not as easy as with numbers...
THANKS AGAIN!
-
glad it worked...
j
-
another question.
to get all files in a playlist, given the playlist name (PlayListName), i wrote something like this:
For z = -2 To MJPlaylists.GetNumberPlaylists - 1
MJPlaylist = MJPlaylists.GetPlaylist(z)
If MJPlaylist.Name = PlayListName then
Dim MJFiles as MediaCenter.IMJFilesAutomation
PLFilesObject = MJPlaylist.GetFiles()
exit for
end if
Next z
it works, but looping trough all playlists and testing their name is very slow; is there another (smarter and faster) way to get a PlayList object given a playlist name?