mirror of
https://github.com/beetbox/beets.git
synced 2026-01-30 12:02:41 +01:00
escape url-problematic characters like # in gstplayer
This commit is contained in:
parent
84d5ef9807
commit
10b4d31784
1 changed files with 5 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ import gobject
|
|||
import thread
|
||||
import os
|
||||
import copy
|
||||
import urllib
|
||||
|
||||
class GstPlayer(object):
|
||||
"""A music player abstracting GStreamer's Playbin element.
|
||||
|
|
@ -101,7 +102,10 @@ class GstPlayer(object):
|
|||
path.
|
||||
"""
|
||||
self.player.set_state(gst.STATE_NULL)
|
||||
self.player.set_property("uri", ("file://" + path).encode('utf-8'))
|
||||
if isinstance(path, unicode):
|
||||
path = path.encode('utf8')
|
||||
uri = 'file://' + urllib.quote(path)
|
||||
self.player.set_property("uri", uri)
|
||||
self.player.set_state(gst.STATE_PLAYING)
|
||||
self.playing = True
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue