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
92be3f0c
Commit
92be3f0c
authored
May 31, 2018
by
Hugo Beauzée-Luyssen
Browse files
parser: Store duration in the task item
parent
b38d6e79
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/metadata_services/MetadataParser.cpp
View file @
92be3f0c
...
...
@@ -200,7 +200,7 @@ parser::Task::Status MetadataParser::run( parser::Task& task )
track
.
language
(),
track
.
description
()
);
}
}
task
.
media
->
setDuration
(
task
.
vlcMedia
.
duration
()
);
task
.
media
->
setDuration
(
task
.
item
()
.
duration
()
);
t
->
commit
();
},
std
::
move
(
tracks
)
);
}
...
...
src/metadata_services/vlc/VLCMetadataService.cpp
View file @
92be3f0c
...
...
@@ -148,6 +148,7 @@ void VLCMetadataService::mediaToItem( VLC::Media& media, parser::Task::Item& ite
media
.
meta
(
libvlc_meta_DiscNumber
)
);
item
.
setMeta
(
parser
::
Task
::
Item
::
Metadata
::
DiscTotal
,
media
.
meta
(
libvlc_meta_DiscTotal
)
);
item
.
setDuration
(
media
.
duration
()
);
auto
subItems
=
media
.
subitems
();
if
(
subItems
!=
nullptr
)
...
...
src/parser/Task.cpp
View file @
92be3f0c
...
...
@@ -170,6 +170,16 @@ void Task::Item::addSubItem( Task::Item item )
m_subItems
.
emplace_back
(
std
::
move
(
item
)
);
}
int64_t
Task
::
Item
::
duration
()
const
{
return
m_duration
;
}
void
Task
::
Item
::
setDuration
(
int64_t
duration
)
{
m_duration
=
duration
;
}
bool
Task
::
restoreLinkedEntities
()
{
LOG_INFO
(
"Restoring linked entities of task "
,
m_id
);
...
...
src/parser/Task.h
View file @
92be3f0c
...
...
@@ -117,10 +117,14 @@ public:
const
std
::
vector
<
Item
>&
subItems
()
const
;
void
addSubItem
(
Item
mrl
);
int64_t
duration
()
const
;
void
setDuration
(
int64_t
duration
);
private:
std
::
string
m_mrl
;
std
::
unordered_map
<
Metadata
,
std
::
string
>
m_metadata
;
std
::
vector
<
Item
>
m_subItems
;
int64_t
m_duration
;
};
static_assert
(
std
::
is_move_assignable
<
Item
>::
value
,
"Item must be move assignable"
);
...
...
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