Index: contrib/file.py ================================================================== --- contrib/file.py +++ contrib/file.py @@ -29,23 +29,22 @@ # Bugs: # Only loads directories on startup. Doesn't work when post-activated # per pluginmanager2 for instance. And LANG=C breaks it on startup, # if media directories contain anything but ASCII filenames. # -# Currently does not play files with UTF characters on Windows. -# # If your player doesn't play local files try unchecking "Convert file path to 'file:///' style URL". (Might happen on Windows when not using VLC.exe). -# When using VLC however it must be checked. # # After checking/unchecking restart Streamtuner2 for recollecting the local files. # modules import os import re +import sys from channels import * from config import * +from compat2and3 import urlquote # ID3 libraries try: from mutagen import File as get_meta except: @@ -245,17 +244,21 @@ # extract meta data def file_entry(self, fn, dir): # basic data url = ("%s/%s" % (dir, fn)) - url = url.replace("\\", "/") + url = url.replace("\\", "/") if conf.file_browser_converttourl: - url = url.replace(" ", "%20") + url = urlquote(url.encode('utf-8'),":/") # needed also in VLC 2.0.8 on Ubuntu 12.04 + #url = url.replace(" ", "%20") # for better readability on Ubuntu..., but not working with VLC 2.08 if url.startswith("/"): url = "file://" + url else: url = "file:///" + url + else: + if conf.windows: + url=url.replace("/","\\",1) #1st slash must be backslash for VLC on Windows meta = { "title": "", "filename": fn, "url": url, "genre": "", @@ -272,11 +275,11 @@ # add streaminfo if streaminfo.info: # no streaminfo.info, maybe ID3 available try: if not streaminfo.info.bitrate == 0: meta.update({"bitrate": streaminfo.info.bitrate/1000}) - except: #FLAC and M4A do not have bitrate property + except: #FLAC bitrate available in Mutagen 1.36; for M4A not available pass if not streaminfo.info.length == 0.0: #FLAC sometimes have it... meta.update({"length": ddhhmmss(int(streaminfo.info.length))}) # add ID3 meta.update(mutagen_postprocess(streaminfo) or {})