[RELEASE] SageTV recordings - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +---- Forum: Video Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=154) +---- Thread: [RELEASE] SageTV recordings (/showthread.php?tid=138838) |
[RELEASE] SageTV recordings - kricker - 2012-08-22 This is an addon to allow access to recordings from a SageTV server. You need to be running the SageTV webserver plugin in Sage to use this addon. It was started using Aaronb's code from this post. Thanks to some hard work by LehighBri it has come a long way and new things are being added weekly if not daily. SageTV can be found in the official XBMC repo under Video-addons. Bleeding edge development can be found at: https://github.com/kricker/plugin.video.SageTV Dependencies: SageTV with:
RE: [RELEASE] SageTV recordings - LehighBri - 2012-08-22 Fantastic (considering I still use SageTV as my DVR but am trying hard to find an alternative). Until then, I got your plugin setup and configured and it pulls in my list of recordings which is good. Couple questions though: 1. What is the default sort for the recordings and can that be altered? I have XBMC sort by date descending, but it looks like it is sorting by title descending. 2. I can't get XBMC to play a show (I've updated the configuration to point to my sage recordings directory but my UNC path is blank... is it an either/or or do I need to fill in both.... perhaps one for playback, one for metadata?) 3. How much, if at all, do you plan to enhance this? RE: [RELEASE] SageTV recordings - kricker - 2012-08-22 1. You should be able to change the sort to whatever you want. I have. 2. Both items need to be filled in. What the addon does is replace the local file path name in the Sage DB and replace it with the UNC path you specified. If they are both on the sam PC then you might be able to skip the UNC part. 3. Probably not much. I took the code from aaronb's post. I hardly understand Python, much less able to write it. RE: [RELEASE] SageTV recordings - LehighBri - 2012-08-22 (2012-08-22, 20:30)kricker Wrote: 1. You should be able to change the sort to whatever you want. I have.I can get it to sort by title, but the sorting by date doesn't appear to be working. (2012-08-22, 20:30)kricker Wrote: 2. Both items need to be filled in. What the addon does is replace the local file path name in the Sage DB and replace it with the UNC path you specified. If they are both on the sam PC then you might be able to skip the UNC part.That worked... I can playback now which is great. Only thing to consider is to make sure you end your SageTV folder path with a "\" or else playback won't work. RE: [RELEASE] SageTV recordings - kricker - 2012-08-22 You're right it appears that sorting by date isn't working properly. Maybe someone can view the code and figure out why. The default value should have had the trailing "\" in it. RE: [RELEASE] SageTV recordings - LehighBri - 2012-08-23 I know a little bit about python as well as the SageTV metadata structure and am willing to spend some development effort on this. I'd love it if it could operate a little more like the SageTV functionality in terms of the hierarchy... e.g. something like "All Shows" -> List of all shows -> List of all episodes for that show I see how "xbmcplugin.addDirectoryItem" is used to add the top level "All Shows" directory, but I'd love some quick help on how to create Show specific sub-directories beneath that, that would still act as directories, and then when those are clicked, a list of episodes specific to that show would appear. Thoughts? The only other issue is sorting... looks like the date is pulled into xbmc's aired field in "yyyy-mm-dd" format but the sorting on that isn't working. Could use some guidance there too. RE: [RELEASE] SageTV recordings - dinki - 2012-08-23 @LehighBri, I pm'd aaronb about creating folders per show. This is his reply: Quote:To create a folder for each show you can use the commented out lines in the add-on as an example and modify them for your needs. For example, using this one: Perhaps this will be of some help in getting the program list a bit more organized. I think this plugin has a lot of promise but I can't see scrolling through a ton of episodes to find the right one. RE: [RELEASE] SageTV recordings - kricker - 2012-08-23 I think it somehow needs to create the list of series automatically. I can't imagine having to set that up each time by hand to get a new series listed. There were some plugins and scripts long ago that did a similar thing to this current plugin and more. There may be some some code that can be borrowed and updated to work with XBMC's current addon structure. Original SageTV script written by Coolwave then maintained by me from 2009. Plugin version of the script written by jhh from 2009. RE: [RELEASE] SageTV recordings - dinki - 2012-08-23 You can also modify the search string to show only Tv Files (/sage/Search?searchType=TVFiles&xml=yes). The XML will then list all of your Tv files (tag <title>) . Parse that then create a loop that passes a single instance of the TV Title to: addDir('TV Title',strUrl + '/sage/Search?searchType=TVFiles&SearchString=TV Title&xml=yes',2,'something.jpg') Not sure about how the image is displayed but perhaps the tv banners that TV Explorer could be used. Also not sure how fast it would be. Anyone up for trying this? RE: [RELEASE] SageTV recordings - kricker - 2012-08-23 Sure. If you work up the code and send it to me, I'll test it. RE: [RELEASE] SageTV recordings - LehighBri - 2012-08-23 Making some progress. Add the following code to the bottom of the CATEGORIES method. Sorting still needs to be figured out... but it's a start on the path to having first the directory structure show the show titles, then you can drill into that to see the episodes: Code: req = urllib.urlopen(strUrl + '/sage/Recordings?xml=yes') RE: [RELEASE] SageTV recordings - dinki - 2012-08-23 I've tried modifying the CATEGORIES function like this: Code: def CATEGORIES(): The first few lines were just a test to see if I could get the folders to appear. They did and it works great. I then tried copying a portion from VIDEOLINKS function to try and pull the title names from a generic show-all-recordings type query on the sage server. I'm doing a check to make sure we only send the title once to the addDir function. I'm getting an error but I'm not sure where. Can someone spot what I'm doing wrong? I'm a hacker, not a programmer, so any help would be great. RE: [RELEASE] SageTV recordings - kricker - 2012-08-23 LehighBri, That works well. Looks like we need to do some fixing of special characters like "&" though. Right now they show up as & RE: [RELEASE] SageTV recordings - LehighBri - 2012-08-23 I fixed the ampersand in the title issue and also sorted the shows initially in alphabetical order. Try this (just copy over your existing CATEGORIES function) Code: def CATEGORIES(): RE: [RELEASE] SageTV recordings - dinki - 2012-08-23 @LehighBri ... I'm trying to use your modification but am having trouble due to a special character in one of the program names. The title contains the é character. I'm getting this error: Code: 13:27:55 T:1232 ERROR: Error Type: <type 'exceptions.UnicodeEncodeError'> *EDIT* Figured out how to sanitize the content. You need to: Code: import unicodedata and add to the section where the & are fixed: Code: strTitle = unicodedata.normalize('NFKD', strTitle).encode('ascii','ignore') |