[blam] FeedUpdater: Remove unnecessary GenerateItemId()



commit b138154e9fa9be39dae22ad144212af260c42944
Author: Carlos Martín Nieto <carlos cmartin tk>
Date:   Wed Sep 15 04:31:58 2010 +0100

    FeedUpdater: Remove unnecessary GenerateItemId()

 src/FeedUpdater.cs |   23 ++---------------------
 1 files changed, 2 insertions(+), 21 deletions(-)
---
diff --git a/src/FeedUpdater.cs b/src/FeedUpdater.cs
index efc9c7c..f300810 100644
--- a/src/FeedUpdater.cs
+++ b/src/FeedUpdater.cs
@@ -65,17 +65,9 @@ namespace Imendio.Blam {
                 channel.Name = HtmlUtils.StripHtml(feed.Title.Text.Trim());
             }
 
+            updated = true;
             foreach(SyndicationItem item in feed.Items){
-                bool ItemUpdated = false;
-                string id = null;
-
-                id = GenerateItemId(item);
-
-                ItemUpdated = channel.UpdateItem(id, item);
-
-                if(ItemUpdated){
-                    updated = true;
-                }
+                channel.Add(new Item(item));
             }
 
             channel.FinishRefresh();
@@ -105,16 +97,5 @@ namespace Imendio.Blam {
             }
         }
     }
-
-        public static string GenerateItemId(SyndicationItem item)
-        {
-            if(item.Id != null){
-                return item.Id;
-            } else if(item.Links[0].Uri.ToString() != null){
-                return item.Links[0].Uri.ToString();
-            } else {
-                return item.Title.Text;
-            }
-        }
     }
 }



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