[banshee/1.5.1-fixes: 20/56] [PlayQueueSource] Check on start up if the offset value is valid (bgo#600498)



commit 43875852cbd41c8eae83fd61cc3d736fced31fe5
Author: Alexander Kojevnikov <alexander kojevnikov com>
Date:   Tue Nov 3 13:40:47 2009 +1100

    [PlayQueueSource] Check on start up if the offset value is valid (bgo#600498)

 .../Banshee.PlayQueue/PlayQueueSource.cs           |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs b/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs
index 75c3747..c35381e 100644
--- a/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs
+++ b/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs
@@ -59,7 +59,7 @@ namespace Banshee.PlayQueue
         private ITrackModelSource prior_playback_source;
         private DatabaseTrackInfo current_track;
         private Shuffler shuffler;
-        private long offset;
+        private long offset = -1;
         private TrackInfo prior_playback_track;
         private PlayQueueActions actions;
         private bool was_playing = false;
@@ -115,7 +115,12 @@ namespace Banshee.PlayQueue
 
             TrackModel.Reloaded += HandleReloaded;
 
-            Offset = CurrentOffsetSchema.Get ();
+            Offset = Math.Min (
+                CurrentOffsetSchema.Get (),
+                ServiceManager.DbConnection.Query<long> (@"
+                    SELECT MAX(ViewOrder)
+                    FROM CorePlaylistEntries
+                    WHERE PlaylistID = ?", DbId));
         }
 
         protected override void Initialize ()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]