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
a8f82d12
Commit
a8f82d12
authored
Dec 15, 2015
by
Hugo Beauzée-Luyssen
Browse files
FsDiscoverer: Create a mountpoint representation when adding a new directory
parent
de3e020a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/discoverer/FsDiscoverer.cpp
View file @
a8f82d12
...
...
@@ -26,7 +26,9 @@
#include
<queue>
#include
"factory/FileSystem.h"
#include
"filesystem/IMountpoint.h"
#include
"Media.h"
#include
"Mountpoint.h"
#include
"Folder.h"
#include
"logging/Logger.h"
#include
"MediaLibrary.h"
...
...
@@ -72,6 +74,15 @@ bool FsDiscoverer::discover( const std::string &entryPoint )
auto
f
=
Folder
::
create
(
m_dbConn
,
fsDir
->
path
(),
0
,
fsDir
->
isRemovable
(),
0
);
if
(
f
==
nullptr
)
return
false
;
// Since this is the "root" folder, we will always try to add its mountpoint to our mountpoint list.
// We can then check if the subfolders mountpoint are different
auto
mountpointFs
=
fsDir
->
mountpoint
();
auto
mountpoint
=
Mountpoint
::
fromUuid
(
m_dbConn
,
mountpointFs
->
uuid
()
);
if
(
mountpoint
==
nullptr
)
{
LOG_INFO
(
"Creating new mountpoint "
,
mountpointFs
->
uuid
()
);
mountpoint
=
Mountpoint
::
create
(
m_dbConn
,
mountpointFs
->
uuid
(),
mountpointFs
->
isRemovable
()
);
}
checkFiles
(
fsDir
.
get
(),
f
);
checkSubfolders
(
fsDir
.
get
(),
f
,
blist
);
f
->
setLastModificationDate
(
fsDir
->
lastModificationDate
()
);
...
...
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