xbmc/xbmc — pull request #5789 by Montellese (2014-11-23 10:37:04+00:00)
Title: Improve runtime in video library

This is based on the discussion in http://trac.xbmc.org/ticket/14524. Right now we always store the scraped runtime of a video in the database but when we also know the stream details of an item (which is not always the case) we replace the scraped runtime with the one from stream details. But stream details are loaded asynchronously to the user interface listing and in JSON-RPC it's possible to not load them at all. In these cases the runtime value is the scraped one which can be off by a lot (often several minutes on episodes).

This adds the logic to overwrite the scraped runtime with the one from stream details when we load stream details. Unfortunately this only works for newly added items and not for items already in the library. But I first wanted to start the discussion and see what people think before looking into adding logic to also handle existing library items.

The problem basically comes from the fact that we don't load/read streamdetails during library scanning (probably to not slow things down) but maybe it would be worth investigating how much impact it would have if we already loaded the stream details during library scanning.