Add folders to music library RRS feed

  • Question

  • hey

    Is it possible to add folders to the music library?


    Monday, September 23, 2013 10:06 PM


All replies

  • Do you mean to add an existing folder to the library collection or to create a new folder within the library?

    For the former see the StorageLibrary class and the Library Management sample. For the latter see CreateFolderAsync(String) | createFolderAsync(String) method


    Monday, September 23, 2013 10:49 PM
  • Hello mcosmin,

    Yes, it is possible. try this step

    1. First open your Package.appxmanifest file from project.
    2. Go to Capability tab & check the Music Library .
    3. Code:
    StorageFolder fold = await KnownFolders.MusicLibrary.CreateFolderAsync("foldername",CreationCollisionOption.OpenIfExists);

    Tuesday, September 24, 2013 7:08 AM
  • OK so I want the user to choose the folder manually.

    If I do this, I get an ArgumentException: The param is incorrect in the last line.

                FolderPicker picker = new FolderPicker();
                var folder = await picker.PickSingleFolderAsync();
                var  r= await KnownFolders.MusicLibrary.CreateFolderAsync(folder.Path, CreationCollisionOption.OpenIfExists);

    I don't want to create a new empty folder. I want to add a folder which already exists. Sorry I didn't explain this earlier.

    SO according to Rob, this can't be done programmatically.

    • Edited by mcosmin Tuesday, September 24, 2013 8:56 AM
    Tuesday, September 24, 2013 8:52 AM
  • The Xbox Music application does this so the question is HOW?

    Dan Ardelean

    Tuesday, November 19, 2013 11:45 AM
  • Xbox music has this capability because it runs with higher privileges than other apps.

    I have no clue why this particular functionality is blocked, since I do not see any possible security breach that might occur.

    Tuesday, November 19, 2013 1:05 PM
  • "higher privileges" is that it uses the Windows 8.1 API rather than Windows 8. You can too. I've updated my previous post in this thread. See the Library Management sample
    • Marked as answer by mcosmin Tuesday, November 19, 2013 4:39 PM
    Tuesday, November 19, 2013 3:15 PM
  • Ok, so why do you need different classes to do it?

    I'm lost xD.

    well at least this is good news.

    • Edited by mcosmin Tuesday, November 19, 2013 4:39 PM
    Tuesday, November 19, 2013 4:38 PM
  • It's a new feature for Windows 8.1. Programmatically managing the library was not supported on Windows 8.


    Tuesday, November 19, 2013 4:53 PM
  • Tuesday, November 19, 2013 9:03 PM
  • At the time I created this thread, 8.1 was still in developer preview, so i assumed it didn't work for 8.1 either and didn't do additional research into new APIs.
    Tuesday, November 19, 2013 9:24 PM