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
c52cf069
Commit
c52cf069
authored
Oct 07, 2021
by
Hugo Beauzée-Luyssen
Browse files
parser: Task: Use enum_to_string
parent
b3676f79
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/parser/Task.cpp
View file @
c52cf069
...
...
@@ -39,6 +39,7 @@
#include
"utils/Filename.h"
#include
"utils/Url.h"
#include
"utils/Strings.h"
#include
"utils/Enums.h"
#include
<algorithm>
...
...
@@ -148,8 +149,7 @@ bool Task::saveParserStep()
static
const
std
::
string
req
=
"UPDATE "
+
Table
::
Name
+
" SET step = ?, "
"attempts_left = "
"(CASE type "
"WHEN "
+
std
::
to_string
(
static_cast
<
std
::
underlying_type_t
<
Type
>>
(
Type
::
Link
)
)
+
" "
"WHEN "
+
utils
::
enum_to_string
(
Type
::
Link
)
+
" "
"THEN (SELECT max_link_task_attempts FROM Settings) "
"ELSE (SELECT max_task_attempts FROM Settings) END) "
"WHERE id_task = ?"
;
...
...
@@ -598,12 +598,10 @@ std::string Task::trigger(Task::Triggers trigger, uint32_t dbModel )
" BEGIN "
"DELETE FROM "
+
Table
::
Name
+
" "
"WHERE link_to_type = "
+
std
::
to_string
(
static_cast
<
std
::
underlying_type_t
<
IItem
::
LinkType
>>
(
IItem
::
LinkType
::
Playlist
)
)
+
" "
utils
::
enum_to_string
(
IItem
::
LinkType
::
Playlist
)
+
" "
"AND link_to_id = old.id_playlist "
"AND type = "
+
std
::
to_string
(
static_cast
<
std
::
underlying_type_t
<
Type
>>
(
Type
::
Link
)
)
+
";"
utils
::
enum_to_string
(
Type
::
Link
)
+
";"
"END"
;
}
...
...
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