Commit 8197da5f authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

Genre: Use enum_to_string

parent 8e0e6dde
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "Artist.h" #include "Artist.h"
#include "Media.h" #include "Media.h"
#include "database/SqliteQuery.h" #include "database/SqliteQuery.h"
#include "utils/Enums.h"
namespace medialibrary namespace medialibrary
{ {
...@@ -278,8 +279,7 @@ std::string Genre::trigger( Triggers trigger, uint32_t dbModel ) ...@@ -278,8 +279,7 @@ std::string Genre::trigger( Triggers trigger, uint32_t dbModel )
return "CREATE TRIGGER " + triggerName( trigger, dbModel ) + return "CREATE TRIGGER " + triggerName( trigger, dbModel ) +
" AFTER UPDATE OF is_present ON " + Media::Table::Name + " AFTER UPDATE OF is_present ON " + Media::Table::Name +
" WHEN new.subtype = " + " WHEN new.subtype = " +
std::to_string( static_cast<typename std::underlying_type<IMedia::SubType>::type>( utils::enum_to_string( IMedia::SubType::AlbumTrack ) +
IMedia::SubType::AlbumTrack ) ) +
" AND old.is_present != new.is_present" " AND old.is_present != new.is_present"
" BEGIN" " BEGIN"
" UPDATE " + Table::Name + " SET is_present = is_present + " " UPDATE " + Table::Name + " SET is_present = is_present + "
......
Supports Markdown
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