Having issues of matching videos to subtitles when they're served over UPnP. Already made a bug in the wrong place, reproduced below even though my initial guestimate was somewhat wrong.
======
"Using raspbmc but this relates to script.xbmc.subtitles so I hope that has nothing to do with it.
When playing video over UPnP, script.xbmc.subtitles tries to search either via filename or parent directory name. With UPnP both of these are either API bits or numeric id's and as such useless. A relevant log line to illustrate; 15:40:34 T:1102639104 NOTICE: COMXPlayer: Opening:
http://192.168.10.1:8200/MediaItems/16289.avi
Could you add an option for seaching with the UPnP provided original filename? They're already handled fairly well, even in the add-on the correct name is displayed at the top, only not used for the search itself. Kinda sucks to manually type out every single search with a remote :-)"
======
Since I don't see an option to attach a file, debug.log here:
http://arcadia.nocturnal.fi/xbmc.log.txt .. interesting bits with debug enabled at the bottom.
Looking at the full debug output my original guestimate is wrong, the retrieved filename is used in most cases (raw filename used apparently as a fallback, for prepopping the manual search and some debug output at least..) The main problem seems to be that since the stream is assumed non-hashable the only method to search with is the "filename" which in my case doesn't seem to match on any site where it actually gets pushed.
Grepping through your source it seems there are various ways to do hashing but most depend on some basic hash of a limited set of the file data. Even though the files are served over http it is possible to grab a byte range to generate a hash, e.g. in bash:
curl -r 0-5242880
http://192.168.10.1:8200/MediaItems/16296.avi | md5sum
.. should be simple in python as well but might be out of scope for a single add-on? Seems you're doing some of the hashing via XBMC libraries and some manually.
Looking at the UPnP specs the file size and duration can be queried so if those are helpful for searches they are be available (screenshot of UPnP Inspector data:
http://arcadia.nocturnal.fi/inspect.png) .. But this seems out of scope as well if the XBMC UPnP client implementation doesn't already pass that down to add-ons.
And then there's the simpler fix of pre-popping the manual search with "Movie/Episode Title" instead of what's parsed from the File Path. It should be interchangeable for local files, maybe?
Other oddities include the year being populated as 2012. Could that be grabbed from UPnP directly? The file is timestamped for August 2012 but relying on the file creation time seems counter intuitive as a release year.
Any more info or help you need, just shout, or if you like real time comms better, I'm on Freenode as Artanicus.