def is_available (self, music): on_cache = GstMusicPool.is_available (self, music) uri = gnome.vfs.URI (music) if not on_cache and \ uri.is_local and \ gnome.vfs.get_mime_type (music) == 'audio/x-wav': # convert to native filename self.cache[music] = GstCacheEntry (gnome_util.unescape_uri (uri), False) on_cache = True del uri return on_cache
def unique_music_id (self, uri): """ Provides a way of uniquely identifying URI's, in case of user sends: file:///foo%20bar file:///foo bar /foo bar """ uri = gnome.vfs.URI (uri) if uri.scheme == 'file': return gnome_util.unescape_uri (uri) return self.__g_unique_music_id (uri)