support for libgpod >= 0.5.0

git-svn-id: svn://svn.berlios.de/gpodder/trunk@346 b0d088ad-0a06-0410-aad2-9ed5178a7e87
This commit is contained in:
Thomas Perl 2007-07-07 15:04:15 +00:00
parent d14d944ca7
commit 022917c6a7
3 changed files with 20 additions and 4 deletions

View file

@ -1,3 +1,12 @@
Sat, 07 Jul 2007 17:01:59 +0200 <thp@perli.net>
* src/gpodder/libipodsync.py: Added support for the new time_t
type of the "track_released" field from libgpod. This adds
support for libgpod >= 0.5.0 (Python bindings). Thanks to
Todd Zullinger (tmz pobox.com) from the gpod-devel mailing
list for suggesting this check and also thanks to Götz Waschk
(goetz.waschk gmail.com) for initially reporting this problem
* bin/gpodder: Pushed version + release date
Thu, 05 Jul 2007 22:59:19 +0200 <thp@perli.net>
! The channel navigator is here :) Suggested by Carlos. Enjoy.
* src/gpodder/libpodcasts.py: New function get_new_episodes() that

View file

@ -32,8 +32,8 @@ or played back on the user's desktop.
# PLEASE DO NOT CHANGE FORMAT OF __version__ LINE (setup.py reads this)
__author__ = "Thomas Perl <thp@perli.net>"
__version__ = "0.9.3+svn20070704"
__date__ = "2007-07-04"
__version__ = "0.9.3+svn20070707"
__date__ = "2007-07-07"
__copyright__ = "Copyright (c) 2005-2007 %s. All rights reserved." % __author__
__licence__ = "GPL"

View file

@ -442,8 +442,15 @@ class gPodder_iPodSync( gPodderSyncMethod):
# Add release time to track if pubDate is parseable
ipod_date = email.Utils.parsedate(episode.pubDate)
if ipod_date != None:
# + 2082844800 for unixtime => mactime (1970 => 1904)
track.time_released = int(time.mktime(ipod_date) + 2082844800)
try:
# libgpod>= 0.5.x uses a new timestamp format
track.time_released = gpod.itdb_time_host_to_mac(int(time.mktime(ipod_date)))
except:
# old (pre-0.5.x) libgpod versions expect mactime, so
# we're going to manually build a good mactime timestamp here :)
#
# + 2082844800 for unixtime => mactime (1970 => 1904)
track.time_released = int(time.mktime(ipod_date) + 2082844800)
track.title = str(episode.title)
track.album = str(channel.title)