Skip to content
Snippets Groups Projects
Commit 099bd5f2 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Hugo Beauzée-Luyssen
Browse files

Playlist: Account for potential badly encoded mrls

Which might be left over from previous versions


(cherry picked from commit 3dddb7b1)
parent 2db72ab5
Branches 0.6.x
No related tags found
No related merge requests found
......@@ -32,6 +32,7 @@
#include "utils/ModificationsNotifier.h"
#include "utils/Filename.h"
#include "utils/Directory.h"
#include "utils/Url.h"
#include "database/SqliteQuery.h"
#include "medialibrary/filesystem/Errors.h"
......@@ -604,6 +605,9 @@ Playlist::backupPlaylists( MediaLibraryPtr ml, uint32_t dbModel )
continue;
mrl = device->mountpoint() + folderPath + mrl;
}
// account for potential leftovers & badly encoded mrls
mrl = utils::url::decode( mrl );
mrl = utils::url::encode( mrl );
pl.mrls.push_back( std::move( mrl ) );
}
if ( pl.mrls.empty() == true )
......
......@@ -101,7 +101,7 @@ TEST_F( MiscTests, ExportRestorePlaylist )
auto pl1 = std::static_pointer_cast<Playlist>( m_ml->createPlaylist( "Exported Playlist 1" ) );
auto m1 = media[0];
auto m2 = media[1];
auto m3 = m_ml->addExternalMedia( "http://example.org/seaotter.avi" );
auto m3 = m_ml->addExternalMedia( "http://example.org/sea&otter.avi" );
pl1->append( *m1 );
pl1->append( *m2 );
pl1->append( *m3 );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment