Changeset 491 for trunk/Update Podcasts


Ignore:
Timestamp:
02/16/09 06:24:38 (11 years ago)
Author:
Nicholas Riley
Message:

Detect downloads of podcasts, not just of feeds; display status; don't update before syncing to avoid syncing the same podcast data twice (requires manual podcast update schedule to be completely effective).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Update Podcasts/update_podcasts.py

    r489 r491  
    77import htmlentitydefs
    88import re
     9import sys
    910import time
    1011
     
    8283    iTunes.playlists[its.special_kind == AEEnum('kSpP')].reveal()
    8384    podcast_status = iTunes_main_pane().outlines[1].rows.static_texts[1].value
    84     while u'queued for download' in podcast_status.get():
     85    while any(status in (u'downloading', u'queued for download')
     86              for status in podcast_status.get()):
    8587        time.sleep(0.5)
    8688
     
    9496if __name__ == '__main__':
    9597    iTunes = app('iTunes')
    96     iTunes.updateAllPodcasts() # start downloading
    97     iTunes.update() # sync iPod
     98    print >> sys.stderr, 'Synchronizing iPod...'
     99    iTunes.update()
    98100    wait_for_iPod_update(iTunes)
     101    print >> sys.stderr, 'Updating podcasts...'
    99102    iTunes.updateAllPodcasts()
    100103    wait_for_podcast_update(iTunes)
     104    print >> sys.stderr, 'Copying podcast descriptions to lyrics...'
    101105    podcasts_to_lyrics(iTunes)
    102106    iTunes.update()
Note: See TracChangeset for help on using the changeset viewer.