Search code examples
windows-phone-7media-library

Uniquely identify albums and songs in Windows Phone media library


I am importing a songs collection from an Album object that is obtained from querying MediaLibrary on Windows Phone Mango.

Is there a unique identifier provided by the platform, by which I could be identifying different songs and albums?

I need something that will remain the same for the same albums if I re-query the MediaLibrary next time my app is ran.

I have seen a "handle" property in the debugger, but it doesn't appear in any of the Album class documentation.


Solution

  • I'd try GetHashCode() for Song and Album. At least Song overrides this function directly, so hopefully it is computed from the song's properties.