Index: action.py ================================================================== --- action.py +++ action.py @@ -266,15 +266,11 @@ url = row["url"] # e.g. from .m3u to .pls else: url = convert_playlist(row["url"], listfmt(source), listfmt(dest), local_file=True, row=row) # insert quoted URL/filepath - #return re.sub(rx, quote(url), cmd.replace("%%", "%"), 2, re.X) - if conf.windows: - return re.sub(rx, quote(url), cmd.replace("%%", "%"), 2, re.X) - else: - return re.sub(rx, quote(url).replace("\\", "/"), cmd.replace("%%", "%"), 2, re.X) + return re.sub(rx, quote(url), cmd.replace("%%", "%"), 2, re.X) if not add_default: return cmd else: Index: contrib/file.py ================================================================== --- contrib/file.py +++ contrib/file.py @@ -1,11 +1,11 @@ # api: streamtuner2 # title: File browser # description: Displays mp3/oggs or m3u/pls files from local media file directories. # type: channel # category: local -# version: 0.2 +# version: 0.3.2 # priority: optional # status: unsupported # depends: python:mutagen, python:id3 # config: # { name: file_browser_dir, type: text, value: "$XDG_MUSIC_DIR, ~/MP3", description: "List of directories to scan for audio files." }, @@ -191,10 +191,17 @@ return dict(env) # don't load cache file cache = lambda *x: None + + + # override: set force=0 always, as otherwise list gets cleared (bug) + # Called on switching genre/category, or loading a genre for the first time. + def load(self, category, force=False, y=None): + log.UI("no reloading for file plugin") + ChannelPlugin.load(self, self.current, force=0) # read dirs def scan_dirs(self): self.categories = [] @@ -228,14 +235,15 @@ # extract meta data def file_entry(self, fn, dir): # basic data + url = ("%s/%s" % (dir, fn)).replace("\\", "/") meta = { "title": "", "filename": fn, - "url": "file://" + dir + "/" + fn, + "url": url, "genre": "", "album": "", "artist": "", "length": "n/a", "bitrate": "n/a", @@ -272,10 +280,10 @@ def update_categories(self): self.scan_dirs() # same as init - def update_streams(self, cat, x=0): + def update_streams(self, cat, *k, **kw): self.scan_dirs() return self.streams.get(os.path.basename(cat)) Index: st2.py ================================================================== --- st2.py +++ st2.py @@ -305,12 +305,10 @@ action.browser(url) # Reload stream list in current channel-category def on_reload_clicked(self, widget=None, reload=1): log.UI("on_reload_clicked()", "reload=", reload, "current_channel=", self.current_channel, "c=", self.channels[self.current_channel], "cat=", self.channel().current) - if self.current_channel == "file": # reload is removing entries without Station Title... - reload=0 self.thread(self._on_reload, self.channel(), reload) def _on_reload(self, channel, reload): self.channel().load(channel.current, force=reload) if reload: try: self.bookmarks.heuristic_update(self.current_channel, channel.category)