Groove Metadata (database)

Here’s some more info on the structure of the Groove Music database.

Schema

As mentioned the database is in ESE format.  The tables within are pretty much just like any other database.  And in Groove Music’s case, you have the expected elements of Artist, Album, Tracks, and Genre.  Most of the fields are what you would expect them to be.  Here’s a brief analysis on some things you might be curious about.

tblPerson

This table holds the Artist info, but it’s more than just the band name.  It also includes credits in each song’s ID3 tag, like composer, artist, albumartist, etc.  This means you’re going to have a lot more “Persons” than bands in your library.  Especially when dealing with compilation albums.  Other fields:

tblAudioAlbum

This table is the list of albums in the library.

tblTrack

This table lists the songs.  There’s lots of interesting info in here that needs more exploration.  I have three albums in the cloud.  Two I purchased back from the Zune days, and one I just uploaded to OneDrive from my hard drive.  I’ll reference these in the interesting fields.

  • CloudCollectionContentId – This seems to be a guid to use in a link to an online file.  This is populated for both my purchased and uploaded albums
  • BlockFromCloud – Always true
  • ActionableMediaId – I assume this is a Guid that points to a matched online track. It’s blank on my more obscure albums.
  • InCloudCollection – True for the three albums I have in OneDrive and Store-purchased
  • CatalogId – The same as ActionableMediaId, but there are more CatalogIds than ActionableMediaIds.  Maybe ActionableMediaId means it can be used online instead of just having information?
  • AlbumImageId – A Guid that is used to get the album art from web services
  • AlbumImageSource – A number that likely represents the URL to get the image from (zuneimages, music.microsoft.com, or musicimages.xbox.com).
  • UniqueFileId – These values are similar to what Windows Media Player used to store in the ID3 tag when it would apply its metadata from its store.

So still, plenty to learn about this database.

Groove Metadata (album art)

As a previous post mentioned, the metadata for Groove is in an ESENT database.  One of the big questions is where does it get its artwork from?

Album Artwork

Groove will get its album artwork from one of two places: from the file metadata or from xbox catalog web services at http://musicimage.xboxlive.com  (probably former Zune services).  It does not use folder.jpg, nor does it use ZuneArt_{guid}.jpg.  It will only access the web services if you have the Media Info option set to automatically retrieve missing metadata.

In order to get good album artwork, your metadata needs to be pristine and has to match what’s in the xbox metadata services.  That’s unreliable at best.  The best solution is to embed your artwork in your media files.

If you want to wipe out your library and rebuild from scratch, you can rename the randomly-(or not)-named folder in:

%userprofile%\AppData\Local\Packages\Microsoft.ZuneMusic_8wekyb3d8bbwe\LocalState\Database

Why wipe out the library?  If you have a massive amount of artwork that originally was downloaded from the xbox services and now you have all that artwork in your media files, it’s faster to let Groove rescan your library than to update each album’s artwork.

As Groove is collecting the album art, it keeps a cache of the images in:

%userprofile%\AppData\Local\Packages\Microsoft.ZuneMusic_8wekyb3d8bbwe\LocalState\ImageStore

It doesn’t seem to matter if the image comes from the file or from the web services.

Artist Images

How, when and where does Groove get its artist info?

Although the ID3 specification does provide a way to embed an artist image, there isn’t currently a common utility that lets you do it.  Doesn’t matter anyway since Groove doesn’t read the metadata fro artist images.

Like the album art cache, artists are stored in:

%userprofile%\AppData\Local\Packages\Microsoft.ZuneMusic_8wekyb3d8bbwe\LocalState\ImageCache\20

And the way Groove gets the artist images is by searching the music.xbox.com site based on your metadata.  If there’s no match,m or if music.xbox.com doesn’t have that artist in the marketplace, that’s about where it ends.  There doesn’t appear to be a way to override this yet.

Windows 10 Groove Music – Zune On

Overview

With the release of Windows 10 comes a new music application, Groove Music.  Groove Music has Zune DNA, except that it loses any Windows Media Player (WMP) or Zune syncing capability.  The assumption is that the mobile phone is the new MP3 player and file copy is the preferred method of syncing.  For better or worse, this is the new normal.

Groove is much closer to the aesthetics of Zune than of WMP, and aside from the lost syncing capability and the toned-down Now Playing screen, it’s a reasonable Zune replacement – as a music player.  Syncing, well… not as much.  You have your usual views: Artist, Album, Song, Playlists, plus Albums for an Artist.  Genre view is missing.  Typing will expand the hamburger menu and put the text in the search box, proving immediate search.  Of course you have the Marketplace, to purchase and download more content.

Technical Details

Groove is a successor to Zune, although the outward branding does not hint at it.  The code library is called ZuneMusic and is found at %userprofile%\AppData\Local\Packages\Microsoft.ZuneMusic_8wekyb3d8bbwe.  In the subfolder LocalState you will find plenty of runtime details.  LocalState has a folder for the database, which is in ESENT format.  There are the ImageCache and imageStore folders that hold album artwork and artists photos from the Zune web services.

As far as the database is concerned, it seems to be similar if not exact to the old Zune database, which was in SQL Server Compact format.  The most common tables would be: tblAudioAlbum, tblPerson, tblGenre, and tblTrack to hold the music metadata and tblFolder and tblFile to hold the physical file references.

There are utilities and libraries to work with ESENT databases.  One is called ESENT Workbench.  If you do want to play around with the database, you may need to do a repair on it because it may not have shut down cleanly.  You can run the command “esentutl.exe /p EntClientDb.edb” to clean up the files for reading.

The Groove Music app uses another couple of packages extensively: Microsoft.Windows.CloudExperienceHost and Microsoft.Windows.ContentDeliveryManager, but probably not for primary functions.  The majority of data is likely pulled from the Zune web services, since the entries in the matadata database tables have references to GUIDs that, when used with the web services, retrieve the proper artist or album info.

The database for Groove Music appears to sync between computers, which makes a lot of sense for cloud-based music, but may get hairy when different machines have different local files.

Extension Ideas

What can be done with having access to the music database?  My impetus for this research was trying to change the Now playing slideshow to use all the artist pictures like Zune does, instead of a single album picture.  I haven’t gotten that far yet.  But some ideas for apps would be:

  • Statistic app showing most played artists, albums, songs, genres
  • Smart playlist generator based on statistics
  • Statistics on files: sizes, bitrates, dates, and something intriguing called FingerprintData
  • Utility to clean, purge, delete, export library
  • Post Now Playing, Recently Played to social media
  • Create a smart sync utility that utilizes the library’s metadata with file copy