Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
9ec0db36
Commit
9ec0db36
authored
Jul 08, 2016
by
Hugo Beauzée-Luyssen
Browse files
MediaLibrary: Create the thumbnail folder if it doesn't exist
parent
8e305ba2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/MediaLibrary.cpp
View file @
9ec0db36
...
...
@@ -22,6 +22,7 @@
#include
<algorithm>
#include
<functional>
#include
<sys/stat.h>
#include
"Fixup.h"
...
...
@@ -197,6 +198,12 @@ bool MediaLibrary::initialize( const std::string& dbPath, const std::string& thu
if
(
m_fsFactory
==
nullptr
)
m_fsFactory
.
reset
(
new
factory
::
FileSystemFactory
);
Folder
::
setFileSystemFactory
(
m_fsFactory
);
if
(
mkdir
(
thumbnailPath
.
c_str
(),
S_IRWXU
)
!=
0
)
{
if
(
errno
!=
EEXIST
)
throw
std
::
runtime_error
(
std
::
string
(
"Failed to create thumbnail directory: "
)
+
strerror
(
errno
)
);
}
m_thumbnailPath
=
thumbnailPath
;
m_callback
=
mlCallback
;
m_dbConnection
.
reset
(
new
SqliteConnection
(
dbPath
)
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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