summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Burt <gabriel.burt@gmail.com>2009-10-13 10:36:43 -0700
committerGabriel Burt <gabriel.burt@gmail.com>2009-10-13 10:37:37 -0700
commitb7edd1864a50ec41fed29dd652f96618bf56d984 (patch)
treed28b98d1266f89fc3ea69f2bbc7eae9f5bf981f2
parent4010c9962f41c06398ab3d8ea230a357b970fd73 (diff)
Fix some db migration issues1.5.1
-rw-r--r--src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs10
-rw-r--r--src/Core/Banshee.Services/Banshee.Library/MusicLibrarySource.cs7
2 files changed, 11 insertions, 6 deletions
diff --git a/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs b/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs
index 780f4b6cd..36dd90ea8 100644
--- a/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs
+++ b/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs
@@ -349,10 +349,10 @@ namespace Banshee.Database
[DatabaseVersion (7)]
private bool Migrate_7 ()
{
- Execute ("UPDATE CorePrimarySources SET StringID = 'MusicLibrarySource-Library' WHERE StringID = 'Library'");
- Execute ("UPDATE CorePrimarySources SET StringID = 'VideoLibrarySource-VideoLibrary' WHERE StringID = 'VideoLibrary'");
- Execute ("UPDATE CorePrimarySources SET StringID = 'PodcastSource-podcasting' WHERE StringID = 'podcasting'");
- Execute ("DELETE FROM CoreCache; DELETE FROM CoreCacheModels");
+ try { Execute ("UPDATE CorePrimarySources SET StringID = 'MusicLibrarySource-Library' WHERE StringID = 'Library'"); } catch {}
+ try { Execute ("UPDATE CorePrimarySources SET StringID = 'VideoLibrarySource-VideoLibrary' WHERE StringID = 'VideoLibrary'"); } catch {}
+ try { Execute ("UPDATE CorePrimarySources SET StringID = 'PodcastSource-podcasting' WHERE StringID = 'podcasting'"); } catch {}
+ try { Execute ("DELETE FROM CoreCache; DELETE FROM CoreCacheModels"); } catch {}
return true;
}
@@ -725,7 +725,7 @@ namespace Banshee.Database
{
try {
// Make paths not relative for Music Library items
- string library_path = Banshee.Library.LibrarySource.OldLocationSchema.Get ();
+ string library_path = Banshee.Library.LibrarySource.OldLocationSchema.Get (Banshee.Library.MusicLibrarySource.GetDefaultBaseDirectory ());
if (library_path != null) {
int podcast_src_id = connection.Query<int> ("SELECT PrimarySourceID FROM CorePrimarySources WHERE StringID = 'PodcastSource-PodcastLibrary'");
diff --git a/src/Core/Banshee.Services/Banshee.Library/MusicLibrarySource.cs b/src/Core/Banshee.Services/Banshee.Library/MusicLibrarySource.cs
index c59602697..35ce580c3 100644
--- a/src/Core/Banshee.Services/Banshee.Library/MusicLibrarySource.cs
+++ b/src/Core/Banshee.Services/Banshee.Library/MusicLibrarySource.cs
@@ -69,9 +69,14 @@ namespace Banshee.Library
PreferencesPage.Add (new Section ("misc", Catalog.GetString ("Miscellaneous"), 10));
}
+
+ public static string GetDefaultBaseDirectory ()
+ {
+ return Banshee.Base.Paths.GetXdgDirectoryUnderHome ("XDG_MUSIC_DIR", "Music");
+ }
public override string DefaultBaseDirectory {
- get { return Banshee.Base.Paths.GetXdgDirectoryUnderHome ("XDG_MUSIC_DIR", "Music"); }
+ get { return GetDefaultBaseDirectory (); }
}
public override IEnumerable<SmartPlaylistDefinition> DefaultSmartPlaylists {