[banshee] [InternetArchive] Use the new integer support in Hyena.Json



commit 8b8d8a817b3d864f0166e5e39318eebabb35ded7
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Sat Nov 7 13:59:53 2009 +0100

    [InternetArchive] Use the new integer support in Hyena.Json
    
    We can now avoid some explicit casts from double to int.

 .../InternetArchive/Details.cs                     |    6 +++---
 .../InternetArchive/DetailsReview.cs               |    4 ++--
 .../InternetArchive/SearchResult.cs                |    4 ++--
 .../InternetArchive/SearchResults.cs               |    4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/Extensions/Banshee.InternetArchive/InternetArchive/Details.cs b/src/Extensions/Banshee.InternetArchive/InternetArchive/Details.cs
index c85729d..e021b7f 100644
--- a/src/Extensions/Banshee.InternetArchive/InternetArchive/Details.cs
+++ b/src/Extensions/Banshee.InternetArchive/InternetArchive/Details.cs
@@ -129,15 +129,15 @@ namespace InternetArchive
         }
 
         public long DownloadsAllTime {
-            get { return (int)item.Get<double> ("downloads"); }
+            get { return item.Get<int> ("downloads"); }
         }
 
         public long DownloadsLastMonth {
-            get { return (int)item.Get<double> ("month"); }
+            get { return item.Get<int> ("month"); }
         }
 
         public long DownloadsLastWeek {
-            get { return (int)item.Get<double> ("week"); }
+            get { return item.Get<int> ("week"); }
         }
 
         public DateTime DateCreated {
diff --git a/src/Extensions/Banshee.InternetArchive/InternetArchive/DetailsReview.cs b/src/Extensions/Banshee.InternetArchive/InternetArchive/DetailsReview.cs
index 789bb68..e3d5db0 100644
--- a/src/Extensions/Banshee.InternetArchive/InternetArchive/DetailsReview.cs
+++ b/src/Extensions/Banshee.InternetArchive/InternetArchive/DetailsReview.cs
@@ -46,11 +46,11 @@ namespace InternetArchive
         }
 
         public long Id {
-            get { return (long) review.Get<double> ("review_id"); }
+            get { return review.Get<int> ("review_id"); }
         }
 
         public int Stars {
-            get { return (int) review.Get<double> ("stars"); }
+            get { return review.Get<int> ("stars"); }
         }
 
         public string Title {
diff --git a/src/Extensions/Banshee.InternetArchive/InternetArchive/SearchResult.cs b/src/Extensions/Banshee.InternetArchive/InternetArchive/SearchResult.cs
index a3694be..158961d 100644
--- a/src/Extensions/Banshee.InternetArchive/InternetArchive/SearchResult.cs
+++ b/src/Extensions/Banshee.InternetArchive/InternetArchive/SearchResult.cs
@@ -72,7 +72,7 @@ namespace InternetArchive
         }
 
         public int Downloads {
-            get { return (int) Get<double> (Field.Downloads); }
+            get { return Get<int> (Field.Downloads); }
         }
 
         public double AvgRating {
@@ -96,7 +96,7 @@ namespace InternetArchive
         }
 
         public int Year {
-            get { return (int) Get<double> (Field.Year); }
+            get { return Get<int> (Field.Year); }
         }
 
         public T Get<T> (Field field)
diff --git a/src/Extensions/Banshee.InternetArchive/InternetArchive/SearchResults.cs b/src/Extensions/Banshee.InternetArchive/InternetArchive/SearchResults.cs
index 56a452e..2ab233a 100644
--- a/src/Extensions/Banshee.InternetArchive/InternetArchive/SearchResults.cs
+++ b/src/Extensions/Banshee.InternetArchive/InternetArchive/SearchResults.cs
@@ -58,8 +58,8 @@ namespace InternetArchive
             if (response != null) {
                 results = response.Get<JsonArray> ("docs");
 
-                TotalResults = (int) response.Get<double> ("numFound");
-                Offset = (int) response.Get<double> ("start");
+                TotalResults = response.Get<int> ("numFound");
+                Offset = response.Get<int> ("start");
             }
         }
 



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