In order to show a file detail like the 1080p
, 4K
, or HDR
badge for a given piece of content in the UI, Infuse assumedly needs to analyze the file. Analyzing that file means it needs to be available in some way, like on a filesystem, for example.
In configurations where a user has “Jellyfin, Emby, or Plex as a source Infuse will rely on the specs provided by those servers instead of reading the files and generating its own specs.” In a sense, because the details of a given file are never analyzed, they are lazily accepted. The source has already done the heavy work of analyzing the file and so Infuse does not need to read the file itself and figure out its codec and a myriad of other file metadata. Infuse does not need to have the file available to it at that moment in order to index it for a Library.
I would love to extend that functionality into an option that simply disables detailed file analysis on everything… until a file needs to be streamed. In other words, lazy load the detailed file analysis until the very moment it needs to be known.
What that would mean is that a fresh index of files would get you most of the way to having the visually rich Library browsing experience. Metadata from online services would fill descriptions, posters, ratings, actors, trailers, collections, etc. That alone gives you the visually rich Library browsing experience. What it would leave out are the badges, and maybe some filters that can isolate all HDR
movies or all 4K
movies.
Why?
This will mean 1) faster indexing times, but—and this is where my personal motivations come in—it also means that 2) in cases where you have a filesystem that can optimize away files like iCloud Drive, a file does not need to be completely available at the moment of indexing. iCloud Drive’s “optimize” feature works by ultimately turning a regular file into a sparse file (0 blocks) and leaving only its apparent size (e.g., 12.4GB), which you can observe with the stat
command; in other words, the path to the file exists, its name is available, and apparent size, but it occupies zero blocks on the underlying filesystem, which means it occupies no real space on the hard drive.
The way MacOS works with optimized files is simple: the moment the file is attempted to be opened, iCloud Drive seamlessly downloads the contents of the file, or blocks, so that the sparse file (which is exactly what torrents leverage) becomes the real file with its content, and can then be opened and played.
I’ve noticed that Infuse nicely triggers this seamless download (many apps do not), which means that if you request a file over, say, a SMB share, that Infuse will wait for MacOS to download the file, and once its complete it will then stream it over SMB. This is awesome. The flip side to this is that when you add a tonne of content that has been optimized away, Infuse will need to download all those files during its indexing process. This is not awesome.
If Infuse did not need to get a detailed analysis of a file at indexing time, then this seamless iCloud Drive download would never occur, which would mean that the index would be immediate, and the network would not go crazy trying to download potentially thousands of files… for the express purpose of showing a badge and doing all that heavy lifting upfront. Instead, there should be an option to lazy load detailed file analysis to the moment a file is requested to watch so that Infuse can figure out what codec and features to use then.
Thanks!