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

Media: Consider the title case insensitive

parent 012cb5d4
......@@ -446,7 +446,7 @@ bool Media::createTable( DBConnection connection )
"insertion_date UNSIGNED INTEGER,"
"release_date UNSIGNED INTEGER,"
"thumbnail TEXT,"
"title TEXT,"
"title TEXT COLLATE NOCASE,"
"filename TEXT,"
"is_favorite BOOLEAN NOT NULL DEFAULT 0,"
"is_present BOOLEAN NOT NULL DEFAULT 1"
......
......@@ -351,15 +351,21 @@ TEST_F( Medias, SortByAlpha )
m2->setTitle( "Zyxw" );
m2->save();
auto m3 = ml->addFile( "media3.mp3" );
m3->setTitle( "afterA-beforeZ" );
m3->save();
auto media = ml->audioFiles( SortingCriteria::Alpha, false );
ASSERT_EQ( 2u, media.size() );
ASSERT_EQ( 3u, media.size() );
ASSERT_EQ( m1->id(), media[0]->id() );
ASSERT_EQ( m2->id(), media[1]->id() );
ASSERT_EQ( m3->id(), media[1]->id() );
ASSERT_EQ( m2->id(), media[2]->id() );
media = ml->audioFiles( SortingCriteria::Alpha, true );
ASSERT_EQ( 2u, media.size() );
ASSERT_EQ( 3u, media.size() );
ASSERT_EQ( m2->id(), media[0]->id() );
ASSERT_EQ( m1->id(), media[1]->id() );
ASSERT_EQ( m3->id(), media[1]->id() );
ASSERT_EQ( m1->id(), media[2]->id() );
}
TEST_F( Medias, SortByLastModifDate )
......
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