banshee r3878 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Sources src/Dap/Banshee.Dap/Banshee.Dap
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r3878 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Sources src/Dap/Banshee.Dap/Banshee.Dap
- Date: Mon, 5 May 2008 19:22:39 +0100 (BST)
Author: abock
Date: Mon May 5 18:22:39 2008
New Revision: 3878
URL: http://svn.gnome.org/viewvc/banshee?rev=3878&view=rev
Log:
2008-05-05 Aaron Bockover <abock gnome org>
* src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs: Moved the smart playlist
purging to a separate method
* src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs: Load
the DbId when it is first requested
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs
trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs Mon May 5 18:22:39 2008
@@ -95,7 +95,24 @@
protected int dbid;
public int DbId {
- get { return dbid; }
+ get {
+ if (dbid > 0) {
+ return dbid;
+ }
+
+ dbid = ServiceManager.DbConnection.Query<int> ("SELECT PrimarySourceID FROM CorePrimarySources WHERE StringID = ?", UniqueId);
+ if (dbid == 0) {
+ dbid = ServiceManager.DbConnection.Execute ("INSERT INTO CorePrimarySources (StringID) VALUES (?)", UniqueId);
+ } else {
+ SavedCount = ServiceManager.DbConnection.Query<int> ("SELECT CachedCount FROM CorePrimarySources WHERE PrimarySourceID = ?", dbid);
+ }
+
+ if (dbid == 0) {
+ throw new ApplicationException ("dbid could not be resolved, this should never happen");
+ }
+
+ return dbid;
+ }
}
public ErrorSource ErrorSource {
@@ -173,13 +190,6 @@
private void PrimarySourceInitialize ()
{
- dbid = ServiceManager.DbConnection.Query<int> ("SELECT PrimarySourceID FROM CorePrimarySources WHERE StringID = ?", UniqueId);
- if (dbid == 0) {
- dbid = ServiceManager.DbConnection.Execute ("INSERT INTO CorePrimarySources (StringID) VALUES (?)", UniqueId);
- } else {
- SavedCount = ServiceManager.DbConnection.Query<int> ("SELECT CachedCount FROM CorePrimarySources WHERE PrimarySourceID = ?", dbid);
- }
-
// Scope the tracks to this primary source
track_model.Condition = String.Format ("CoreTracks.PrimarySourceID = {0}", dbid);
Modified: trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs (original)
+++ trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs Mon May 5 18:22:39 2008
@@ -70,13 +70,12 @@
public override void Dispose ()
{
+ PurgeBuiltinSmartPlaylists ();
PurgeTracks ();
}
- protected override void PurgeTracks ()
+ private void PurgeBuiltinSmartPlaylists ()
{
- base.PurgeTracks ();
-
ServiceManager.DbConnection.Execute (new HyenaSqliteCommand (@"
BEGIN TRANSACTION;
DELETE FROM CoreSmartPlaylistEntries WHERE SmartPlaylistID IN
@@ -91,6 +90,8 @@
protected override void Initialize ()
{
+ PurgeBuiltinSmartPlaylists ();
+
base.Initialize ();
Expanded = true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]