This has happened to me several times. My media is stored on a network drive. If the drive is unavailable all of the playlists that I've created are empty. Even after rescanning the folder and being able to play music again the playlists remain empty. Is there any way to repopulate the playlists without having to recreate them? And if not is there a way to prevent it Madsonic from making them empty when the files aren't available or backing up the config on a hourly/daily basis and then restoring it to prevent this from happening again?

I had a similar problem recently when I rearranged my directory structure. After the restructure, all my playlists appeared empty.

Note that the playlists have the concept of active and inactive entries, but I've never seen a way to get Madsonic to export a playlist with all the entries, including the inactive ones.

So I created some symlinks in the directory, added a new folder entry in Madsonic to temporarily recreate the older file structure. After a rescan, I had double the song entries, BUT more importantly, all the older playlists were populated again. It looks like the playlists are rechecked at the end of the media scan process because the playlists didn't show populated until the scan was complete.

At that point I exported all playlists, removed the temporary folder entry in Madsonic, removed symlinks, deleted all playlists in Madsonic, recan and database cleanup. At this point I have all songs scanned, a clean database, and no playlists. Using a text editor, I edited the exported playlists to reflect the newly modified directory structure, then imported all the playlists. I had to use the Madsonic database editor to change the owner of the lists back to their original owner, but that was better than telling everyone that the playlists were lost (yet again).

My suggestion is to periodically export the playlists so you can edit them externally and re-import them when this happens again. However, I would have expected your playlists to be restored once the media was restored.

I was hoping that they would be restored once the media was restored, which it has been. I also ran a scan but the playlists are all still empty. I can play songs that are in the playlists, and the playlists are still listed but they all show [0] for number of items.

I had the same problem. The only way to "fix" it (for now) is to create your playlists, EXPORT them, and make a copy of them in another folder. Then import them from that folder if they ever go blank again.

Also note that you do NOT want to do the full scan with cleanup...that will also wipe out all the entries in your playlists.

If you look at the database structures for playlists, you will note that that it is a large database that simply has a playlist ID with a media identifier, which is assigned to an asset during media scan. I'm guessing once that ID changes in some way, the playlist is then referencing an invalid ID and it shows empty. I don't think there is any way to recover a playlist once that happens.