Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Hugo Beauzée-Luyssen
medialibrary
Commits
dd759b37
Commit
dd759b37
authored
Oct 07, 2021
by
Hugo Beauzée-Luyssen
Browse files
Album: Use enum_to_string
parent
27c91635
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Album.cpp
View file @
dd759b37
...
...
@@ -32,6 +32,7 @@
#include
"Genre.h"
#include
"Media.h"
#include
"Thumbnail.h"
#include
"utils/Enums.h"
#include
"database/SqliteTools.h"
#include
"database/SqliteQuery.h"
...
...
@@ -600,8 +601,7 @@ std::string Album::trigger( Triggers trigger, uint32_t dbModel )
return
"CREATE TRIGGER "
+
triggerName
(
trigger
,
dbModel
)
+
" AFTER UPDATE OF is_present ON "
+
Media
::
Table
::
Name
+
" WHEN new.subtype = "
+
std
::
to_string
(
static_cast
<
typename
std
::
underlying_type
<
IMedia
::
SubType
>::
type
>
(
IMedia
::
SubType
::
AlbumTrack
)
)
+
utils
::
enum_to_string
(
IMedia
::
SubType
::
AlbumTrack
)
+
" BEGIN "
" UPDATE "
+
Table
::
Name
+
" SET is_present=is_present + "
"(CASE new.is_present WHEN 0 THEN -1 ELSE 1 END)"
...
...
@@ -615,8 +615,7 @@ std::string Album::trigger( Triggers trigger, uint32_t dbModel )
return
"CREATE TRIGGER "
+
triggerName
(
trigger
,
dbModel
)
+
" AFTER UPDATE OF is_present ON "
+
Media
::
Table
::
Name
+
" WHEN new.subtype = "
+
std
::
to_string
(
static_cast
<
typename
std
::
underlying_type
<
IMedia
::
SubType
>::
type
>
(
IMedia
::
SubType
::
AlbumTrack
)
)
+
utils
::
enum_to_string
(
IMedia
::
SubType
::
AlbumTrack
)
+
" AND old.is_present != new.is_present"
" BEGIN "
" UPDATE "
+
Table
::
Name
+
" SET is_present=is_present + "
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment