xbmc/xbmc — pull request #1719 by axmhari (2012-11-02 00:16:47+00:00)
Title: [pvr] Update internal naming of PVR items for better library integration

I have prepared an update for the library integration of PVR items.

First of all I must say, that my first approach, using the date as part of the directory structure, turned out to be not optimal. The idea was to present a unique but still clean (i.e. human readable) file name for each recording. But when adding the material to the library, the full path (and not the "simulated" path without date) will be used and each PVR file requires one path entry. As a result thumbnails and fanarts are not available in the "Files" view, because the items seem not a be a member of the directory (originally this was functioning, but it stopped working with some update).

So I am proposing a new naming style for recordings:
pvr://recordings/\/\, TV (\), \_\.pvr

It has the advantage, that the original path structure of the PVR server is maintained. Furthermore two recordings of the same time from different channels are supported. By adding the cleaning tag "tv" in advanced settings, this stuff after the title is ignored when scraping from the library view. For direct scraping the recording title is used now instead of the filename.

Of course this change would break any already assembled library of PVR material. However, I think, that the new naming style is cleaner from the programming point of view and it fixes the "Files" view. I fear that we may run into some other problems with the current naming style in the future.

I also removed loading of thumbs from GetDirectory. This will cause a huge speed up, when scanning large PVR directories. It is so fast in my tests, that no busy box is displayed during update and the problem of #1702 will not show up (just as a comment, it still needs a fix and the directory history is of course still missing). The functionality is transfered to a background thread. I also made the library information available for PVR items, so that scraped material will show a thumbnail and a fanart in PVR recordings view.

Please tell me, what you think of it.