Skip to content

Commit

Permalink
Preload first result of YT opened YT playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
np1 committed Mar 3, 2014
1 parent 49fe9af commit e5d6284
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mpsyt
Original file line number Diff line number Diff line change
Expand Up @@ -2383,6 +2383,11 @@ def plist(parturl, pagenum=1, splash=True, dumps=False):
g.ytpl = dict(name=ytpl_title, items=songs)
g.current_page = 1
g.model.songs = songs[:g.max_results]
# preload first result url
kwa = {"song": songs[0], "delay": 0}
t = threading.Thread(target=preload, kwargs=kwa)
t.start()

g.content = generate_songlist_display()
g.message = "Showing YouTube playlist %s" % (c.y + ytpl_title + c.w)

Expand Down

0 comments on commit e5d6284

Please sign in to comment.