[banshee] [AppleDevice] Handle exceptions from libgpod date overflows
- From: Alan McGovern <alanmc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] [AppleDevice] Handle exceptions from libgpod date overflows
- Date: Fri, 17 Sep 2010 21:46:12 +0000 (UTC)
commit b12bb8bb0e15f523714c0d4d017f02e27b4caeed
Author: Alan McGovern <alan mcgovern gmail com>
Date: Fri Sep 17 22:43:05 2010 +0100
[AppleDevice] Handle exceptions from libgpod date overflows
Ignore any errors that libgpod-sharp may throw when setting a DateTime
to a value which is out of range of a 32bit int. This is a workaround
until it can be fixed there. Fixes bug #629838.
[#
.../AppleDeviceTrackInfo.cs | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceTrackInfo.cs b/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceTrackInfo.cs
index d9d71bc..eeaba72 100644
--- a/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceTrackInfo.cs
+++ b/src/Dap/Banshee.Dap.AppleDevice/Banshee.Dap.AppleDevice/AppleDeviceTrackInfo.cs
@@ -187,19 +187,26 @@ namespace Banshee.Dap.AppleDevice
track.BPM = (short)Bpm;
track.Comment = Comment;
track.Composer = Composer;
- track.TimeAdded = DateAdded;
+ track.TimeAdded = DateTime.Now;
track.CDs = DiscCount;
track.CDNumber = DiscNumber;
track.TrackLength = (int) Duration.TotalMilliseconds;
track.Size = (int)FileSize;
track.Grouping = Grouping;
- track.TimePlayed = LastPlayed;
+ try {
+ track.TimePlayed = LastPlayed;
+ } catch {
+ Hyena.Log.InformationFormat ("Couldn't set TimePlayed to '{0}'", LastPlayed);
+ }
track.PlayCount = (uint) PlayCount;
track.Tracks = TrackCount;
track.TrackNumber = TrackNumber;
track.Year = Year;
- track.TimeReleased = ReleaseDate;
-
+ try {
+ track.TimeReleased = ReleaseDate;
+ } catch {
+ Hyena.Log.InformationFormat ("Couldn't set TimeReleased to '{0}'", ReleaseDate);
+ }
track.Album = AlbumTitle;
track.Artist = ArtistName;
track.Title = TrackTitle;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]