def refresh(self): playlists = {} encoding = sys.getfilesystemencoding() for path in glob.glob(os.path.join(self._playlists_dir, b'*.m3u*')): relpath = os.path.basename(path) uri = translator.path_to_playlist_uri(relpath) name = os.path.splitext(relpath)[0].decode(encoding, 'replace') tracks = translator.parse_m3u(path) playlists[uri] = Playlist(uri=uri, name=name, tracks=tracks) self._playlists = playlists logger.info('Loaded %d M3U playlists from %s', len(playlists), self._playlists_dir)
def refresh(self): playlists = {} encoding = sys.getfilesystemencoding() for path in glob.glob(os.path.join(self._playlists_dir, b'*.m3u*')): relpath = os.path.basename(path) uri = translator.path_to_playlist_uri(relpath) name = os.path.splitext(relpath)[0].decode(encoding, 'replace') tracks = translator.parse_m3u(path) playlists[uri] = Playlist(uri=uri, name=name, tracks=tracks) self._playlists = playlists logger.info( 'Loaded %d M3U playlists from %s', len(playlists), self._playlists_dir)
def parse(self, name): return translator.parse_m3u(name, data_dir)
def parse(self, name): return translator.parse_m3u(name, data_dir)