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
c348a6e5
Commit
c348a6e5
authored
Jan 21, 2016
by
Hugo Beauzée-Luyssen
Browse files
MediaLibrary: Move setFsFactory to test code
parent
92ff27f5
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/IMediaLibrary.h
View file @
c348a6e5
...
...
@@ -96,12 +96,6 @@ class IMediaLibrary
///
virtual
bool
initialize
(
const
std
::
string
&
dbPath
,
const
std
::
string
&
thumbnailPath
,
IMediaLibraryCb
*
metadataCb
)
=
0
;
virtual
void
setVerbosity
(
LogLevel
v
)
=
0
;
/**
* Replaces the default filesystem factory
* The default one will use standard opendir/readdir functions
* Calling this after initialize() is not a supported scenario.
*/
virtual
void
setFsFactory
(
std
::
shared_ptr
<
factory
::
IFileSystem
>
fsFactory
)
=
0
;
virtual
LabelPtr
createLabel
(
const
std
::
string
&
label
)
=
0
;
virtual
bool
deleteLabel
(
LabelPtr
label
)
=
0
;
...
...
src/MediaLibrary.cpp
View file @
c348a6e5
...
...
@@ -114,11 +114,6 @@ MediaLibrary::~MediaLibrary()
m_dbConnection
->
release
();
}
void
MediaLibrary
::
setFsFactory
(
std
::
shared_ptr
<
factory
::
IFileSystem
>
fsFactory
)
{
m_fsFactory
=
fsFactory
;
}
bool
MediaLibrary
::
createAllTables
()
{
auto
t
=
m_dbConnection
->
newTransaction
();
...
...
src/MediaLibrary.h
View file @
c348a6e5
...
...
@@ -50,7 +50,6 @@ class MediaLibrary : public IMediaLibrary
~
MediaLibrary
();
virtual
bool
initialize
(
const
std
::
string
&
dbPath
,
const
std
::
string
&
thumbnailPath
,
IMediaLibraryCb
*
metadataCb
)
override
;
virtual
void
setVerbosity
(
LogLevel
v
)
override
;
virtual
void
setFsFactory
(
std
::
shared_ptr
<
factory
::
IFileSystem
>
fsFactory
)
override
;
std
::
vector
<
MediaPtr
>
files
();
virtual
std
::
vector
<
MediaPtr
>
audioFiles
()
override
;
...
...
test/unittest/Tests.cpp
View file @
c348a6e5
...
...
@@ -153,3 +153,8 @@ std::shared_ptr<Device> MediaLibraryTester::addDevice( const std::string& uuid,
{
return
Device
::
create
(
m_dbConnection
.
get
(),
uuid
,
isRemovable
);
}
void
MediaLibraryTester
::
setFsFactory
(
std
::
shared_ptr
<
factory
::
IFileSystem
>
fsFactory
)
{
m_fsFactory
=
fsFactory
;
}
test/unittest/Tests.h
View file @
c348a6e5
...
...
@@ -42,6 +42,7 @@ public:
void
deleteGenre
(
unsigned
int
genreId
);
void
deleteArtist
(
unsigned
int
artistId
);
std
::
shared_ptr
<
Device
>
addDevice
(
const
std
::
string
&
uuid
,
bool
isRemovable
);
void
setFsFactory
(
std
::
shared_ptr
<
factory
::
IFileSystem
>
fsFactory
);
private:
std
::
unique_ptr
<
fs
::
IDirectory
>
dummyDirectory
;
...
...
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