banshee r4093 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Collection.Database src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea



Author: gburt
Date: Tue Jun  3 21:11:53 2008
New Revision: 4093
URL: http://svn.gnome.org/viewvc/banshee?rev=4093&view=rev

Log:
2008-06-03  Gabriel Burt  <gabriel burt gmail com>

	* src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs:
	Get rid of unnecessary Save call; DatabaseTrackInfo already calls save
	when you set the Rating.

	* src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs:
	Expose rating and some other members as protected so subclasses can set it
	without triggering the save (eg to load initial state).

	* src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodTrackInfo.cs:
	* src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpTrackInfo.cs: Hacky fix for
	BGO #535898, use the protected rating member instead of the Rating
	property to initialize the rating, to avoid callign Save when we didn't
	mean to.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
   trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodTrackInfo.cs
   trunk/banshee/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpTrackInfo.cs
   trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs	Tue Jun  3 21:11:53 2008
@@ -395,7 +395,7 @@
         }
         
         [DatabaseColumn ("Rating")]
-        private int rating;
+        protected int rating;
         public override int Rating {
             get { return rating; }
             set {
@@ -444,7 +444,7 @@
         }
         
         [DatabaseColumn ("LastStreamError")]
-        private StreamPlaybackError playback_error;
+        protected StreamPlaybackError playback_error;
         public override StreamPlaybackError PlaybackError {
             get { return playback_error; }
             set {

Modified: trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodTrackInfo.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodTrackInfo.cs	(original)
+++ trunk/banshee/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodTrackInfo.cs	Tue Jun  3 21:11:53 2008
@@ -68,7 +68,7 @@
                 TrackTitle = track.TrackTitle;
                 Genre = track.Genre;
                 Duration = track.Duration;
-                Rating = track.Rating;
+                rating = track.Rating;
                 PlayCount = track.PlayCount;
                 LastPlayed = track.LastPlayed;
                 DateAdded = track.DateAdded;
@@ -107,13 +107,13 @@
             Genre = String.IsNullOrEmpty (track.Genre) ? null : track.Genre;
             
             switch (track.Rating) {
-                case IPod.TrackRating.One:   Rating = 1; break;
-                case IPod.TrackRating.Two:   Rating = 2; break;
-                case IPod.TrackRating.Three: Rating = 3; break;
-                case IPod.TrackRating.Four:  Rating = 4; break;
-                case IPod.TrackRating.Five:  Rating = 5; break;
+                case IPod.TrackRating.One:   rating = 1; break;
+                case IPod.TrackRating.Two:   rating = 2; break;
+                case IPod.TrackRating.Three: rating = 3; break;
+                case IPod.TrackRating.Four:  rating = 4; break;
+                case IPod.TrackRating.Five:  rating = 5; break;
                 case IPod.TrackRating.Zero: 
-                default:                     Rating = 0; break;
+                default:                     rating = 0; break;
             }
             
             if (track.IsProtected) {

Modified: trunk/banshee/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpTrackInfo.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpTrackInfo.cs	(original)
+++ trunk/banshee/src/Dap/Banshee.Dap.Mtp/Banshee.Dap.Mtp/MtpTrackInfo.cs	Tue Jun  3 21:11:53 2008
@@ -58,7 +58,7 @@
             Duration = TimeSpan.FromMilliseconds (file.Duration);
             Genre = file.Genre;
             PlayCount = file.UseCount < 0 ? 0 : (int) file.UseCount;
-            Rating = file.Rating < 0 ? 0 : (file.Rating / 20);
+            rating = file.Rating < 0 ? 0 : (file.Rating / 20);
             TrackTitle = file.Title;
             TrackNumber = file.TrackNumber < 0 ? 0 : (int)file.TrackNumber;
             Year = (file.ReleaseDate != null && file.ReleaseDate.Length >= 4) ? Int32.Parse (file.ReleaseDate.Substring(0, 4)) : 0;

Modified: trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs	Tue Jun  3 21:11:53 2008
@@ -343,7 +343,6 @@
         {
             if (ServiceManager.PlayerEngine.CurrentTrack != null) {
                 ServiceManager.PlayerEngine.CurrentTrack.Rating = rating_menu_item.Value;
-                ServiceManager.PlayerEngine.CurrentTrack.Save (); //true, Banshee.Query.BansheeQuery.RatingField);
                 ServiceManager.PlayerEngine.TrackInfoUpdated ();
             }
         }



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