Permalink
Browse files

MythMusic: Don't append a '/' if the start directory hasn't been set …

…yet.

This fixes a bug which would start the file scanner running from the '/'
directory if the music location hadn't been set.

Also don't bother loading the music when going into the settings screens.
(cherry picked from commit 6ac5bc0)
  • Loading branch information...
Paul Harrison
Paul Harrison committed Jul 17, 2011
1 parent 254c9f7 commit 63b8603f4569c8ae18d24b9f1db5bda6ef069fe6
Showing with 2 additions and 6 deletions.
  1. +2 −6 mythplugins/mythmusic/mythmusic/main.cpp
@@ -194,10 +194,9 @@ static void loadMusic()
}
}
- // Load all available info about songs (once!)
QString startdir = gCoreContext->GetSetting("MusicLocation");
startdir = QDir::cleanPath(startdir);
- if (!startdir.endsWith("/"))
+ if (!startdir.isEmpty() && !startdir.endsWith("/"))
startdir += "/";
Metadata::SetStartdir(startdir);
@@ -590,14 +589,11 @@ int mythplugin_run(void)
int mythplugin_config(void)
{
- //TODO do we need this here?
- loadMusic();
-
gMusicData->paths = gCoreContext->GetSetting("TreeLevels");
gMusicData->startdir = gCoreContext->GetSetting("MusicLocation");
gMusicData->startdir = QDir::cleanPath(gMusicData->startdir);
- if (!gMusicData->startdir.endsWith("/"))
+ if (!gMusicData->startdir.isEmpty() && !gMusicData->startdir.endsWith("/"))
gMusicData->startdir += "/";
Metadata::SetStartdir(gMusicData->startdir);

0 comments on commit 63b8603

Please sign in to comment.