banshee r4647 - in trunk/banshee: . src/Extensions/Banshee.Daap/Banshee.Daap src/Libraries/Hyena/Hyena.Data.Sqlite
- From: gburt svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r4647 - in trunk/banshee: . src/Extensions/Banshee.Daap/Banshee.Daap src/Libraries/Hyena/Hyena.Data.Sqlite
- Date: Fri, 3 Oct 2008 17:28:34 +0000 (UTC)
Author: gburt
Date: Fri Oct 3 17:28:33 2008
New Revision: 4647
URL: http://svn.gnome.org/viewvc/banshee?rev=4647&view=rev
Log:
2008-10-03 Gabriel Burt <gabriel burt gmail com>
* src/Extensions/Banshee.Daap/Banshee.Daap/DaapSource.cs: Add TODO to use
transactions when loading tracks and use slightly better TrackCount method
instead of accessing Tracks.Count twice.
* src/Extensions/Banshee.Daap/Banshee.Daap/DaapTrackInfo.cs: Set BitRate
as well.
* src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs: Add
thoghts on how to fix the transaction bug so we can bring back the
transaction methods. Not going to do it now, too fundamental of a change
too close to 1.4.
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Extensions/Banshee.Daap/Banshee.Daap/DaapSource.cs
trunk/banshee/src/Extensions/Banshee.Daap/Banshee.Daap/DaapTrackInfo.cs
trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs
Modified: trunk/banshee/src/Extensions/Banshee.Daap/Banshee.Daap/DaapSource.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Daap/Banshee.Daap/DaapSource.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.Daap/Banshee.Daap/DaapSource.cs Fri Oct 3 17:28:33 2008
@@ -234,8 +234,8 @@
database.TrackRemoved += OnDatabaseTrackRemoved;
SetStatus (String.Format (Catalog.GetPluralString (
- "Loading {0} track.", "Loading {0} tracks.", database.Tracks.Count),
- database.Tracks.Count), false
+ "Loading {0} track", "Loading {0} tracks", database.TrackCount),
+ database.TrackCount), false
);
// Notify (eg reload the source before sync is done) at most 5 times
@@ -243,6 +243,7 @@
notify_every -= notify_every % 250;
int count = 0;
+ // TODO use transactions when fixed
DaapTrackInfo daap_track = null;
foreach (DAAP.Track track in database.Tracks) {
daap_track = new DaapTrackInfo (track, this);
Modified: trunk/banshee/src/Extensions/Banshee.Daap/Banshee.Daap/DaapTrackInfo.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Daap/Banshee.Daap/DaapTrackInfo.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.Daap/Banshee.Daap/DaapTrackInfo.cs Fri Oct 3 17:28:33 2008
@@ -54,8 +54,9 @@
Year = track.Year;
Duration = track.Duration;
MimeType = track.Format;
+ BitRate = (int)track.BitRate;
ExternalId = track.Id;
-
+
PrimarySource = source;
Uri = new SafeUri (String.Format (
Modified: trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs (original)
+++ trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs Fri Oct 3 17:28:33 2008
@@ -238,6 +238,13 @@
// starts a transaction, then another one tries to execute command A (which locks A) but
// waits for the transaction to finish while holding the lock on A. If the transaction thread
// then tries to execute/lock A, it can't.
+ //
+ // I think the way to fix this is to change all the Query/Execute methods above to not lock
+ // the command themselves, but to let that happen in the QueueCommand method (which can be modified
+ // to either take a param_values array and a HyenaCommandType, or have overrides, etc). That way
+ // the command locking and values applied only when we know the calling thread is not blocking by a
+ // transaction thread.
+ //
/*public void BeginTransaction ()
{
if (transaction_thread == Thread.CurrentThread) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]