Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
medialibrary
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
34
Issues
34
List
Boards
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
medialibrary
Commits
7aac3823
Commit
7aac3823
authored
Jan 12, 2017
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parser: Move fetching of unparsed files in the File class
parent
8fec9b76
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
src/File.cpp
src/File.cpp
+7
-0
src/File.h
src/File.h
+1
-0
src/parser/Parser.cpp
src/parser/Parser.cpp
+1
-4
No files found.
src/File.cpp
View file @
7aac3823
...
...
@@ -275,6 +275,13 @@ std::shared_ptr<File> File::fromExternalMrl( MediaLibraryPtr ml, const std::stri
return
file
;
}
std
::
vector
<
std
::
shared_ptr
<
File
>>
File
::
fetchUnparsed
(
MediaLibraryPtr
ml
)
{
static
const
std
::
string
req
=
"SELECT * FROM "
+
policy
::
FileTable
::
Name
+
" WHERE parser_step != ? AND is_present = 1 AND folder_id IS NOT NULL AND parser_retries < 3"
;
return
File
::
fetchAll
<
File
>
(
ml
,
req
,
File
::
ParserStep
::
Completed
);
}
void
File
::
resetRetryCount
(
MediaLibraryPtr
ml
)
{
static
const
std
::
string
req
=
"UPDATE "
+
policy
::
FileTable
::
Name
+
" SET "
...
...
src/File.h
View file @
7aac3823
...
...
@@ -113,6 +113,7 @@ public:
*/
static
std
::
shared_ptr
<
File
>
fromExternalMrl
(
MediaLibraryPtr
ml
,
const
std
::
string
&
mrl
);
static
std
::
vector
<
std
::
shared_ptr
<
File
>>
fetchUnparsed
(
MediaLibraryPtr
ml
);
static
void
resetRetryCount
(
MediaLibraryPtr
ml
);
private:
...
...
src/parser/Parser.cpp
View file @
7aac3823
...
...
@@ -101,10 +101,7 @@ void Parser::restore()
if
(
m_services
.
empty
()
==
true
)
return
;
static
const
std
::
string
req
=
"SELECT * FROM "
+
policy
::
FileTable
::
Name
+
" WHERE parser_step != ? AND is_present = 1 AND folder_id IS NOT NULL AND parser_retries < 3"
;
auto
files
=
File
::
fetchAll
<
File
>
(
m_ml
,
req
,
File
::
ParserStep
::
Completed
);
auto
files
=
File
::
fetchUnparsed
(
m_ml
);
LOG_INFO
(
"Resuming parsing on "
,
files
.
size
(),
" mrl"
);
for
(
auto
&
f
:
files
)
{
...
...
Write
Preview
Markdown
is supported
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