Proposed changes in Managing On-line Resources
=========================================
My understanding is that in order to play on-line resources via DLNA, for those feeds declared as On-line Streams, RSS-Atoms, and Web Resources in the console, Serviio must determine the attributes of and optionally, the thumbnail for, each individual feed item (stream) in order to be displayed in the DLNA menu on the client device.
Hence, when a feed is added or enabled, Serviio must first build a list of the feed item (stream) url's. For on-line streams this is the single url declared in the console. For RSS-atoms and Web Resources, Serviio first matches the declared feed url against the users installed plug-ins. If an RSS-atom feed url matches a plug-in then the Serviio accesses the feed url to obtain the map of links that must be provided by the feed url, and Serviio then executes the plug-in to extract the feed item (stream) url's from those links. If an RSS-atom does not match a plug-in, Serviio accesses the feed url and extracts the list of feed item (stream) url's contained in the RSS feed url. If a Web Resource feed url matches a plug-in, the plug-in is executed to first build a map of feed item links and then executed to extract the feed item (stream) url's from those links.
Once Serviio has obtained a list of the feed item (stream) url's, it then checks to see if the attributes of those url's have been previously stored in its cache (database). If not, then ffmpeg is executed to obtain the feed item attributes and store them in the cache.
Since the feed items (streams) provided from many sources frequently change, Serviio establishes an expiry date for each feed, being the lesser of the console expiry interval or the feed items expiry defined by the plug-in. When that expiry interval is reached, Serviio will refresh the feed, by repeating the above sequence. Refreshes can also be individually forced for any enabled feed and each enabled feed will be automatically refreshed when Serviio starts.
Once a feed has been processed, its feed items extracted, and their attributes cached, Serviio has the information required to provide any client device with the names of the available feeds., a list of the feed items, and based on the client profile, the format that will be sent to the client for each item. The client user may then select a feed item and the client will request that feed item from Serviio if it is in an acceptable format for the client. Serviio will then send the item in native format or transcode it in real time to the format determined by the client profile. If Serviio is unable to access the online feed item and the item has been defined as "expires immediately" by a plugin, Serviio will again attempt to extract the feed item (stream) url for that link, and obtain the latest valid url in order to access and send the item to the client.
This is an excellent design for managing online resources, and for on-line streams with the immediate availability of the feed item url, or for valid rss links with the availability of all links with the single access of the rss url the building and refresh of feed item url's is near instantaneous.
A problem arises however with those feed items identified by plugins because the extract typically requires multiple url accesses and significant processing to determine each feed item url, which can require many seconds for each feed, and with many enabled feeds and periodic refreshes will utilize considerable resources and delay the availability of feed items during these extended duration refreshes.
The problem is that the current refresh logic involves not only the extract of any new feed item urls, but also the multisecond re-extract of former items to re-obtain their feed item urls, even though in most cases the feed item url is unchanged. The argument for doing this is that the former feed item url may contain a time sensitive key which will be updated by the reextract. The counter argument is that those urls will already have been defined as "expires immediately" and so the re-extract to obtain the new key will automatically occur if required when the original url is accessed, and will likely occur anyway even if a prior forced refresh has occured.
The trade off is obvious: the periodic multisecond reextract of all old urls in all enabled feeds regardless of whether they are ever played versus the single
reextract of a single feed item if the item is ever played. Consequentally the refresh of a stable feed with multiple of feed items will take less than 30 seconds to confirm the stable items rather than many minutes to also reextract the same feed items that Serviio already has. Similarly refreshes will become largely transparent to the user, regardless of the number of enabled feeds, whereas today the user must be cognizant of his feeds and selectively enable them as required in order to minimize the refresh load.
This request therefore is to only extract new feed items on the refresh of any given feed, just as we only invoke ffmpeg for the metadata on new feed items.