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
VideoLAN
medialibrary
Commits
2dbb5190
Commit
2dbb5190
authored
Apr 13, 2015
by
Hugo Beauzée-Luyssen
Browse files
MediaLibrary: Allow a folder to be fetched using its path
parent
389314ee
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/IMediaLibrary.h
View file @
2dbb5190
...
...
@@ -34,12 +34,16 @@ class IMediaLibrary
virtual
bool
initialize
(
const
std
::
string
&
dbPath
)
=
0
;
/// Adds a stand alone file
virtual
FilePtr
addFile
(
const
std
::
string
&
path
)
=
0
;
/// Adds a folder and all the files it contains
virtual
FolderPtr
addFolder
(
const
std
::
string
&
path
)
=
0
;
virtual
FilePtr
file
(
const
std
::
string
&
path
)
=
0
;
virtual
bool
deleteFile
(
const
std
::
string
&
mrl
)
=
0
;
virtual
bool
deleteFile
(
FilePtr
file
)
=
0
;
/// Adds a folder and all the files it contains
virtual
FolderPtr
addFolder
(
const
std
::
string
&
path
)
=
0
;
virtual
FolderPtr
folder
(
const
std
::
string
&
path
)
=
0
;
virtual
bool
deleteFolder
(
FolderPtr
folder
)
=
0
;
virtual
LabelPtr
createLabel
(
const
std
::
string
&
label
)
=
0
;
virtual
bool
deleteLabel
(
const
std
::
string
&
label
)
=
0
;
virtual
bool
deleteLabel
(
LabelPtr
label
)
=
0
;
...
...
src/MediaLibrary.cpp
View file @
2dbb5190
...
...
@@ -101,6 +101,11 @@ FolderPtr MediaLibrary::addFolder( const std::string& path )
return
folder
;
}
FolderPtr
MediaLibrary
::
folder
(
const
std
::
string
&
path
)
{
return
Folder
::
fetch
(
m_dbConnection
,
path
);
}
bool
MediaLibrary
::
deleteFile
(
const
std
::
string
&
mrl
)
{
return
File
::
destroy
(
m_dbConnection
,
mrl
);
...
...
src/MediaLibrary.h
View file @
2dbb5190
...
...
@@ -17,9 +17,11 @@ class MediaLibrary : public IMediaLibrary
virtual
std
::
vector
<
FilePtr
>
files
();
virtual
FilePtr
file
(
const
std
::
string
&
path
);
virtual
FilePtr
addFile
(
const
std
::
string
&
path
);
virtual
FolderPtr
addFolder
(
const
std
::
string
&
path
)
override
;
virtual
bool
deleteFile
(
const
std
::
string
&
mrl
);
virtual
bool
deleteFile
(
FilePtr
file
);
virtual
FolderPtr
addFolder
(
const
std
::
string
&
path
)
override
;
virtual
FolderPtr
folder
(
const
std
::
string
&
path
)
override
;
virtual
bool
deleteFolder
(
FolderPtr
folder
)
override
;
virtual
LabelPtr
createLabel
(
const
std
::
string
&
label
);
...
...
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