summaryrefslogtreecommitdiff
path: root/lib/feed2imap/cache.rb
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/feed2imap/cache.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/feed2imap/cache.rb b/lib/feed2imap/cache.rb
index 48913f0..e270f05 100644
--- a/lib/feed2imap/cache.rb
+++ b/lib/feed2imap/cache.rb
@@ -113,6 +113,8 @@ class CachedChannel
# @nbnewitems is set by get_new_items, and is used to limit the number
# of (old) items serialized.
+ UPDATEDDEBUG = false
+
# Returns the really new items amongst items
def get_new_items(items)
# save number of new items
@@ -122,6 +124,13 @@ class CachedChannel
updateditems = []
@itemstemp = @items
items.each { |i| i.cacheditem ||= CachedItem::new(i) }
+ # debug : dump interesting info to stdout.
+ if UPDATEDDEBUG
+ puts "-------Items downloaded :----------"
+ items.each { |i| puts "#{i.cacheditem.to_s}" }
+ puts "-------Items already there :----------"
+ @items.each { |i| puts "#{i.to_s}" }
+ end
items.each do |i|
found = false
# Try to find a perfect match
@@ -146,7 +155,7 @@ class CachedChannel
found = true
# let's put j in front of itemstemp
@itemstemp.delete(j)
- @itemstemp.unshift(j)
+ @itemstemp.unshift(i.cacheditem)
break
end
end
@@ -197,4 +206,8 @@ class CachedItem
def create_index
@index = ItemCache.getindex
end
+
+ def to_s
+ "\"#{@title}\" #{@link} #{@hash}"
+ end
end
ogmsg'> 2008-06-23Finished send_mail workRené 'Necoro' Neumann2-52/+68 2008-06-23Added plugin, which simply throws an exceptionRené 'Necoro' Neumann2-0/+15 2008-06-23Fixed name of gpytage pluginRené 'Necoro' Neumann1-1/+1 2008-06-23Moved GtkThread to gui.utilsRené 'Necoro' Neumann5-29/+25 2008-06-22Implemented the mail sendingRené 'Necoro' Neumann2-3/+63 2008-06-22First mail window draftRené 'Necoro' Neumann3-0/+220 2008-06-10Added gpytage pluginRené 'Necoro' Neumann2-0/+29 2008-06-10Modified plugin.xsd so it allows also menu-only pluginsRené 'Necoro' Neumann2-7/+8 2008-06-10Fixed the default handlingRené 'Necoro' Neumann1-1/+1 2008-06-10Allowed default for session; load 'app-portage/portato' as default for ↵René 'Necoro' Neumann2-10/+18 selections :) 2008-06-09Fixed 'kill' in the systray popupRené 'Necoro' Neumann1-2/+2 2008-06-09Fixed error messageRené 'Necoro' Neumann2-4/+1 2008-06-08Make blocks way more intelligentRené 'Necoro' Neumann3-45/+107