Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
medialibrary
Commits
a7de829e
Commit
a7de829e
authored
Sep 30, 2015
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't send an update for unparsed files.
parent
d7d9a59a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
15 deletions
+5
-15
include/IMediaLibrary.h
include/IMediaLibrary.h
+3
-8
src/MediaLibrary.cpp
src/MediaLibrary.cpp
+0
-4
src/Parser.cpp
src/Parser.cpp
+1
-1
test/VLCMetadataServices.cpp
test/VLCMetadataServices.cpp
+1
-2
No files found.
include/IMediaLibrary.h
View file @
a7de829e
...
...
@@ -13,18 +13,13 @@ class IMediaLibraryCb
public:
virtual
~
IMediaLibraryCb
()
=
default
;
/**
* @brief onMetadataUpdated Will be called when a file gets some updated metadata
* @brief onMetadataUpdated Will be called when a file gets added, or if its metadata
* got updated.
* @param file The updated file.
*/
virtual
void
on
Metadata
Updated
(
FilePtr
file
)
=
0
;
virtual
void
on
File
Updated
(
FilePtr
file
)
=
0
;
virtual
void
onDiscoveryStarted
(
const
std
::
string
&
entryPoint
)
=
0
;
/**
* @brief onFileAdded This will be called for each new file discovered
* or restored when reloading the media library.
* @param file
*/
virtual
void
onFileAdded
(
FilePtr
file
)
=
0
;
virtual
void
onDiscoveryCompleted
(
const
std
::
string
&
entryPoint
)
=
0
;
};
...
...
src/MediaLibrary.cpp
View file @
a7de829e
...
...
@@ -394,10 +394,6 @@ FilePtr MediaLibrary::addFile( const fs::IFile* file, unsigned int folderId )
return
nullptr
;
}
LOG_INFO
(
"Adding "
,
file
->
name
()
);
// Keep in mind that this is queued by the parser thread, there is no waranty about
// when the metadata will be available
if
(
m_callback
!=
nullptr
)
m_callback
->
onFileAdded
(
fptr
);
m_parser
->
parse
(
fptr
,
m_callback
);
return
fptr
;
}
...
...
src/Parser.cpp
View file @
a7de829e
...
...
@@ -90,7 +90,7 @@ void Parser::done( FilePtr file, ServiceStatus status, void* data )
if
(
t
->
it
==
t
->
end
)
{
file
->
setReady
();
t
->
cb
->
on
Metadata
Updated
(
file
);
t
->
cb
->
on
File
Updated
(
file
);
delete
t
;
return
;
}
...
...
test/VLCMetadataServices.cpp
View file @
a7de829e
...
...
@@ -16,14 +16,13 @@ class ServiceCb : public IMediaLibraryCb
std
::
condition_variable
waitCond
;
std
::
mutex
mutex
;
virtual
void
on
Metadata
Updated
(
FilePtr
)
virtual
void
on
File
Updated
(
FilePtr
)
override
{
waitCond
.
notify_all
();
}
// IMediaLibraryCb interface
virtual
void
onDiscoveryStarted
(
const
std
::
string
&
)
override
{}
virtual
void
onFileAdded
(
FilePtr
)
override
{}
virtual
void
onDiscoveryCompleted
(
const
std
::
string
&
)
override
{}
};
...
...
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