diff options
Diffstat (limited to 'src/m3u/m3u.cc')
-rw-r--r-- | src/m3u/m3u.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/m3u/m3u.cc b/src/m3u/m3u.cc index e2ad9d8..795e25b 100644 --- a/src/m3u/m3u.cc +++ b/src/m3u/m3u.cc @@ -55,7 +55,7 @@ static char * split_line (char * line) return feed + 1; } -bool M3ULoader::load (const char * path, VFSFile & file, String & title, +bool M3ULoader::load (const char * filename, VFSFile & file, String & title, Index<PlaylistAddItem> & items) { Index<char> text = file.read_all (); @@ -77,7 +77,7 @@ bool M3ULoader::load (const char * path, VFSFile & file, String & title, if (* parse && * parse != '#') { - StringBuf s = uri_construct (parse, path); + StringBuf s = uri_construct (parse, filename); if (s) items.append (String (s)); } @@ -88,12 +88,13 @@ bool M3ULoader::load (const char * path, VFSFile & file, String & title, return true; } -bool M3ULoader::save (const char * path, VFSFile & file, const char * title, +bool M3ULoader::save (const char * filename, VFSFile & file, const char * title, const Index<PlaylistAddItem> & items) { for (auto & item : items) { - StringBuf line = str_concat ({item.filename, "\n"}); + StringBuf path = uri_deconstruct (item.filename, filename); + StringBuf line = str_concat ({path, "\n"}); if (file.fwrite (line, 1, line.len ()) != line.len ()) return false; } |