cleaned up isDownloaded() function and moved function calls
git-svn-id: svn://svn.berlios.de/gpodder@22 b0d088ad-0a06-0410-aad2-9ed5178a7e87
This commit is contained in:
parent
4861ec6056
commit
87a10dd316
|
@ -81,6 +81,9 @@ class gPodderLib( object):
|
|||
filename = filename[:indexOfQuestionMark]
|
||||
# end strip questionmark
|
||||
return self.getChannelSaveDir( configChannel( channel.title).filename) + filename
|
||||
|
||||
def podcastFilenameExists( self, channel, url):
|
||||
return exists( self.getPodcastFilename( channel, url))
|
||||
|
||||
def downloadRss( self, channel_url, channel_filename = "__unknown__", force_update = True):
|
||||
if channel_filename == "":
|
||||
|
|
|
@ -40,12 +40,9 @@ class podcastChannel(object):
|
|||
for item in self.items:
|
||||
print "-- Item: \"" + item.title + "\""
|
||||
|
||||
def is_downloaded(self, item):
|
||||
#TODO ist this the right place for this function? if yes move imports to head
|
||||
import libgpodder
|
||||
import os
|
||||
filename = libgpodder.gPodderLib().getPodcastFilename(self, item.url)
|
||||
return os.path.exists(filename)
|
||||
def isDownloaded( self, item):
|
||||
from libgpodder import gPodderLib
|
||||
return gPodderLib().podcastFilenameExists( self, item.url)
|
||||
|
||||
def getItemsModel( self):
|
||||
new_model = gtk.ListStore( gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_BOOLEAN, gobject.TYPE_STRING)
|
||||
|
@ -53,8 +50,10 @@ class podcastChannel(object):
|
|||
for item in self.items:
|
||||
# Skip items with no download url
|
||||
if item.url != "":
|
||||
if self.is_downloaded(item): background_color = "#eeeeee"
|
||||
else: background_color = "white"
|
||||
if self.isDownloaded(item):
|
||||
background_color = "#eeeeee"
|
||||
else:
|
||||
background_color = "white"
|
||||
new_iter = new_model.append()
|
||||
new_model.set( new_iter, 0, item.url)
|
||||
new_model.set( new_iter, 1, item.title)
|
||||
|
|
Loading…
Reference in New Issue