The application is a Windows Form Application which starts a backgroundworker thread that opens a WCF WebServiceHost and ServiceEndpoint for the various API endpoints (OperationContract). These endpoints return json objects which are then used to update the Android app views, etc.
Functionally all of this is working quite well except what I’m seeing is that after using the API's if I then try to update a song tag, album art, etc. in the MM library using the MM application itself the database appears to be in a locked state and the update transactions from MM are queued.
In each of my endpoints I create a SDB reference and also set it to "Nothing" at the end of the function before returning the json object. The only thing I can think of is that "scripts" begin and end whereas my applications backgroundworker is always in a listening state so the application never ends.
I’ve search the MM forum extensively for insights but have been unsuccessful in finding any clues as to what I might be doing wrong. Any help on understanding what I might be overlooking would be greatly appreciated.
Example code to ping MM to see if it is in a play or paused state:
Code: Select all
Public Interface IService <OperationContract()> <WebGet(ResponseFormat:=WebMessageFormat.Json, BodyStyle:=WebMessageBodyStyle.Bare)> Function [b]IsPlaying()[/b] As Boolean ……. End Interface Public Class Service Implements IService Public Function [b]IsPlaying[/b]() As Boolean Implements IService.IsPlaying Console.WriteLine("Service:IsPlaying ") Dim SDB = CreateObject("SongsDB.SDBApplication") Dim isPlayingNow As Boolean = False If SDB.Player.isPaused Or Not SDB.Player.isPlaying Then isPlayingNow = False Else isPlayingNow = True End If Console.WriteLine("...isPlayingNow:" & isPlayingNow) SDB = Nothing Return isPlayingNow End Function ………… End Class