SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV v7 Customizations

Notices

SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-15-2011, 08:11 AM
mgpaulus mgpaulus is offline
Sage Advanced User
 
Join Date: Mar 2011
Location: Colorado Springs, CO
Posts: 156
Web import: Can it be made scriptable?

I am running a mythtv system and a Sagetv system in parallel. I have over 900 shows on my mythtv system. I have shared my shows from mythtv via CIFS, and have that drive mounted on my sagetv system with no problems. And I have created a java program to generate an importable xml file from mythtv. I also have a cron job set up to generate comskip files for those mythtv shows.

My question now is, is there a way to do the xml import from a script instead of having to do it from the web interface? Or can I get the xml import code and create a standalone java program that I can run to do the import every night? I have set up my export so that all the mythtv shows have a sub-category of mythtv. This will hopefully make it fairly easy to identify those files.

Oh yeah, as part of this, I would also like eventually either 1) trigger BMT to retrieve missing metadata, or 2) retrieve missing metadata as the data is imported.

I think I would also like to do a delete of all shows with a sub-category of mythtv before I do the import. But I'm not sure how to use the apis to do that stuff yet. Any pointers or examples would be appreciated.
Reply With Quote
  #2  
Old 08-15-2011, 08:19 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,541
Quote:
Originally Posted by mgpaulus View Post
I am running a mythtv system and a Sagetv system in parallel. I have over 900 shows on my mythtv system. I have shared my shows from mythtv via CIFS, and have that drive mounted on my sagetv system with no problems. And I have created a java program to generate an importable xml file from mythtv. I also have a cron job set up to generate comskip files for those mythtv shows.

My question now is, is there a way to do the xml import from a script instead of having to do it from the web interface? Or can I get the xml import code and create a standalone java program that I can run to do the import every night? I have set up my export so that all the mythtv shows have a sub-category of mythtv. This will hopefully make it fairly easy to identify those files.

Oh yeah, as part of this, I would also like eventually either 1) trigger BMT to retrieve missing metadata, or 2) retrieve missing metadata as the data is imported.

I think I would also like to do a delete of all shows with a sub-category of mythtv before I do the import. But I'm not sure how to use the apis to do that stuff yet. Any pointers or examples would be appreciated.
I can answer the BMT question BMT will automatically fetch missing metadata for any files that are added.

Instead of using the xml format, perhaps you could use the .properties format. If you created a .properties file for each of your media files then when sagetv imported them, it would automatically attach that metadata as well.

The only thing that you'd need to do is tell sagetv to look for new media (which would be a simply sagex-api call or web url call).
Reply With Quote
  #3  
Old 08-15-2011, 08:42 AM
mgpaulus mgpaulus is offline
Sage Advanced User
 
Join Date: Mar 2011
Location: Colorado Springs, CO
Posts: 156
Didn't know about .properties file. Since I've done my extract in Java, I could just as easily write a .property file instead of creating xml. I will have to check it out. Any more pointers on .property files?
Reply With Quote
  #4  
Old 08-15-2011, 09:16 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,541
Quote:
Originally Posted by mgpaulus View Post
Didn't know about .properties file. Since I've done my extract in Java, I could just as easily write a .property file instead of creating xml. I will have to check it out. Any more pointers on .property files?
if you have the bmt web ui installed, just navigate to a folder with a few items and select the batch operation, "Export .properties" (not from the tools menu, but from the grey header section). Then look at the .properties. It's pretty straight forward, i think.

Also, if you are using the sagex-apis, then I've created a constant for each property name as well... but personally I'd start with an existing file and see if you can figure it out from there.

I can help you with this as well. Feel free to PM me with information about the .properties
Reply With Quote
  #5  
Old 09-26-2011, 11:20 AM
mgpaulus mgpaulus is offline
Sage Advanced User
 
Join Date: Mar 2011
Location: Colorado Springs, CO
Posts: 156
Well, now I have a couple of issues I need to address.....

When I created the original extract out of mythtv and did the import via the sagetv webpage, apparently I screwed up some of the dates/times so the shows are showing up as either red line (times way off), or some of the shows have partial red line and partial green line. I will research that and figure out why the dates are wrong.

Once I fix that, I would like to rerun the export/import process. However, I would also like to delete all the previously imported files. That shouldn't be too hard, because when I did the import, I set the sub-category to 'mythtv'. But, is there a way to delete all shows based upon a sub-category?
Reply With Quote
  #6  
Old 10-07-2018, 05:20 PM
mgpaulus mgpaulus is offline
Sage Advanced User
 
Join Date: Mar 2011
Location: Colorado Springs, CO
Posts: 156
Sorry to resurrect such an old thread, but.....

Does the importer for V9 still look at the .properties file, or is it using the .my file? I was noticing that my mythtv files are being imported in their native format (chanid_starttime, eg 8727_20181007070000.ts). Turns out I had an error in my script to generate .properties files. I chased that down and corrected it, but it seems like the importer is ignoring the .properties file that is being generated. So I was wondering if something has changed in V9 - either the format of the .properties file, or is V9 using a different file to read in program metadata??

Thanks,

Mark
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I made the leap...to an i3 system panteragstk Hardware Support 32 07-24-2010 02:19 PM
scriptable internet access while maintaining LAN access korben_dallas The SageTV Community 5 12-21-2009 06:11 AM
Tell which tuner made a recording? wirecreative Hardware Support 6 03-13-2008 04:32 PM
Home Made PVR vs Sky P*us Razzle_Dazzle SageTV United Kingdom 5 10-26-2004 04:55 AM
I made a G4TTV icon for anyone that needs it kny3twalker General Discussion 3 06-02-2004 07:12 PM


All times are GMT -6. The time now is 11:26 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.