Use webPage duration if story duration isn't available.

This commit is contained in:
levlam 2023-06-14 16:19:58 +03:00
parent 863ee6ac33
commit a4bf0bffa8

View File

@ -1802,7 +1802,8 @@ int32 WebPagesManager::get_web_page_media_duration(const WebPage *web_page) cons
return web_page->duration;
}
if (!web_page->story_full_ids.empty()) {
return td_->story_manager_->get_story_duration(web_page->story_full_ids[0]);
auto story_duration = td_->story_manager_->get_story_duration(web_page->story_full_ids[0]);
return story_duration >= 0 ? story_duration : web_page->duration;
}
return -1;