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
c7d5c974
Commit
c7d5c974
authored
Oct 09, 2015
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VLCMetadataService: Parse release date
parent
f75f44be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
src/metadata_services/vlc/VLCMetadataService.cpp
src/metadata_services/vlc/VLCMetadataService.cpp
+8
-0
test/VLCMetadataServices.cpp
test/VLCMetadataServices.cpp
+3
-0
No files found.
src/metadata_services/vlc/VLCMetadataService.cpp
View file @
c7d5c974
...
...
@@ -104,7 +104,15 @@ bool VLCMetadataService::parseAudioFile( FilePtr file, VLC::Media& media ) const
return
true
;
auto
album
=
m_ml
->
album
(
albumTitle
);
if
(
album
==
nullptr
)
{
album
=
m_ml
->
createAlbum
(
albumTitle
);
if
(
album
!=
nullptr
)
{
auto
date
=
media
.
meta
(
libvlc_meta_Date
);
if
(
date
.
length
()
>
0
)
album
->
setReleaseDate
(
std
::
stoul
(
date
)
);
}
}
if
(
album
==
nullptr
)
{
LOG_ERROR
(
"Failed to create/get album"
);
...
...
test/VLCMetadataServices.cpp
View file @
c7d5c974
...
...
@@ -97,6 +97,9 @@ TEST_F( VLCMetadataServices, ParseAlbum )
ASSERT_EQ
(
album
->
title
(),
"Boys for Pele"
);
// ASSERT_NE( album->artworkUrl().length(), 0u );
auto
releaseDate
=
album
->
releaseDate
();
ASSERT_NE
(
releaseDate
,
0
);
auto
album2
=
ml
->
album
(
"Boys for Pele"
);
ASSERT_EQ
(
album
,
album2
);
}
...
...
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