iPod sync support: added cover + release time (thanks to Nick)
git-svn-id: svn://svn.berlios.de/gpodder/trunk@170 b0d088ad-0a06-0410-aad2-9ed5178a7e87
This commit is contained in:
parent
1ec20d6acb
commit
f508ed05f5
1
AUTHORS
1
AUTHORS
|
@ -13,6 +13,7 @@ Thanks to all the other patch writers:
|
|||
Stylianos Papanastasiou <stelios@dcs.gla.ac.uk> (patch for "downloaded move")
|
||||
Ortwin Forster <ortwin@videotron.ca> (patch for saxutils.escape in localdb)
|
||||
Camille Moncelier <pix@devlife.org> (patch for iPod video device support)
|
||||
Nick <nikosapi@gmail.com> (patch for iPod podcast release date+cover support)
|
||||
|
||||
|
||||
Thanks for bug reports and other suggestions go out to:
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
Mon, 13 Nov 2006 12:06:12 +0100 <thp@perli.net>
|
||||
* src/gpodder/libipodsync.py: incorporated (slightly modified)
|
||||
patch from (nikosapi gmail com) to add "time released" and
|
||||
cover (for photo/color/nano iPods) to iTunesDB
|
||||
* AUTHORS: updated list of patch writers
|
||||
* bin/gpodder: bumped version + release date
|
||||
|
||||
Sat, 21 Oct 2006 12:15:30 +0200 <thp@perli.net>
|
||||
* src/gpodder/libipodsync.py: Defaulting to 60 minutes podcast time
|
||||
when not able to get real length (and spit out a warning for it)
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
# PLEASE DO NOT CHANGE FORMAT OF __version__ LINE (setup.py reads this)
|
||||
|
||||
__author__ = "Thomas Perl <thp@perli.net>"
|
||||
__version__ = "0.8.0+svn20060808"
|
||||
__date__ = "2006-08-08"
|
||||
__version__ = "0.8.0+svn20061113"
|
||||
__date__ = "2006-11-13"
|
||||
__copyright__ = "Copyright (c) 2005-2006 %s. All rights reserved." % __author__
|
||||
__licence__ = "GPL"
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ except:
|
|||
import os
|
||||
import sys
|
||||
import time
|
||||
import email.Utils
|
||||
|
||||
import libgpodder
|
||||
import liblocaldb
|
||||
|
@ -229,6 +230,12 @@ class gPodder_iPodSync(object):
|
|||
track.artist = 'gPodder podcast'
|
||||
self.set_podcast_flags( track)
|
||||
|
||||
# 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 = time.mktime(ipod_date) + 2082844800
|
||||
|
||||
track.title = str(episode.title)
|
||||
track.album = str(channel.title)
|
||||
track.tracklen = track_length
|
||||
|
@ -241,6 +248,12 @@ class gPodder_iPodSync(object):
|
|||
playlist = self.get_playlist_for_channel( channel)
|
||||
gpod.itdb_playlist_add_track( playlist, track, -1)
|
||||
|
||||
# Copy channel cover file to iPod
|
||||
cover_filename = os.path.dirname( local_filename) + '/cover'
|
||||
if os.path.isfile( cover_filename):
|
||||
# Copy it to the iPod only if it exists
|
||||
gpod.itdb_track_set_thumbnails( track, cover_filename)
|
||||
|
||||
# dirty hack to get video working, seems to work
|
||||
for ext in video_extensions:
|
||||
if local_filename.lower().endswith( '.%s' % ext):
|
||||
|
|
Loading…
Reference in New Issue