Commit ff0c0152 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

File: Fix external files is_network value

refs #253
parent 793eebd0
......@@ -88,7 +88,7 @@ File::File( MediaLibraryPtr ml, int64_t mediaId, int64_t playlistId, IFile::Type
, m_folderId( 0 )
, m_isRemovable( false )
, m_isExternal( true )
, m_isNetwork( utils::file::schemeIs( "file://", mrl ) )
, m_isNetwork( utils::file::schemeIs( "file://", mrl ) == false )
, m_fullPath( mrl )
{
assert( ( mediaId == 0 && playlistId != 0 ) || ( mediaId != 0 && playlistId == 0 ) );
......
......@@ -769,7 +769,22 @@ TEST_F( Medias, ExternalMrl )
ASSERT_EQ( 1u, files.size() );
auto f = files[0];
ASSERT_TRUE( f->isExternal() );
ASSERT_TRUE( f->isNetwork() );
ASSERT_EQ( File::Type::Main, f->type() );
auto f2 = m2->addExternalMrl( "file:///path/to/subtitles.srt", IFile::Type::Subtitles );
ASSERT_NE( nullptr, f2 );
ASSERT_FALSE( f2->isNetwork() );
files = m2->files();
ASSERT_EQ( 2u, files.size() );
ASSERT_TRUE( files[0]->isExternal() );
ASSERT_TRUE( files[0]->isNetwork() );
ASSERT_EQ( File::Type::Main, files[0]->type() );
ASSERT_TRUE( files[1]->isExternal() );
ASSERT_FALSE( files[1]->isNetwork() );
ASSERT_EQ( File::Type::Subtitles, files[1]->type() );
}
TEST_F( Medias, AddStream )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment