SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV v7 Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

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
  #1001  
Old 11-16-2011, 07:13 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Quote:
Originally Posted by graywolf View Post
BTW - Do you happen to have a groovy script to make an Import into a Sage Recording?
It is not a script but you can do this with jrekiwi's Complementary Metadata tool and you can do it from within the Sage UI. This would work well if you just want to change a few recordings but not so good if it is dozens or hundreds.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #1002  
Old 11-16-2011, 11:42 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by graywolf View Post
BTW - Do you happen to have a groovy script to make an Import into a Sage Recording?
Not at this time, however, I'm working on something for my setup that may/probably will require such a script. If I end up writing it, I'll share it here. The strategy, as far as I understand it, is to create a show with an external ID of SH* (or EP* or MV*) and link that newly created show to the imported video - that should make it a Sage recording.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #1003  
Old 11-17-2011, 08:15 AM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Quote:
Originally Posted by wayner View Post
It is not a script but you can do this with jrekiwi's Complementary Metadata tool and you can do it from within the Sage UI. This would work well if you just want to change a few recordings but not so good if it is dozens or hundreds.
OK...know how to make changes like Title/Episode and other Metadata changes using CMT but how do you make an Import into Sage Recording using CMT?
Reply With Quote
  #1004  
Old 11-17-2011, 08:19 AM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Quote:
Originally Posted by Slugger View Post
Not at this time, however, I'm working on something for my setup that may/probably will require such a script. If I end up writing it, I'll share it here. The strategy, as far as I understand it, is to create a show with an external ID of SH* (or EP* or MV*) and link that newly created show to the imported video - that should make it a Sage recording.
Which API is the linking done with? The shows are ExternalID of those. Just trying to read thru all the APIs trying to figure out which one is used to make an Import into a Recording. Think I'm at the point of not being able to see the forest thru the trees
Reply With Quote
  #1005  
Old 11-17-2011, 08:53 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Quote:
Originally Posted by graywolf View Post
OK...know how to make changes like Title/Episode and other Metadata changes using CMT but how do you make an Import into Sage Recording using CMT?
When I click on Manage Metadata (which I assume is using CMT) and then Edit Metadata a full screen of fields comes up including Media Type (TV/Movie).
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #1006  
Old 11-17-2011, 09:06 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by graywolf View Post
Which API is the linking done with? The shows are ExternalID of those. Just trying to read thru all the APIs trying to figure out which one is used to make an Import into a Recording. Think I'm at the point of not being able to see the forest thru the trees
To add an import as a recording, I'd probably make the following API calls in this order (untested, untried; probably will have to experiment a little):

Code:
ShowAPI.AddShow() // Make sure the show you create has an external ID starting with MV, SH or EP
MediaFileAPI.AddMediaFile()
MediaFileAPI.SetMediaFileShow() // Use the Show and MediaFile objs you created in the first calls as the arguments to this call
Let me know if you try this and it works. As I said, I'm probably looking to create a similar script in the near future.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #1007  
Old 11-17-2011, 09:00 PM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Still playing around some. But definitely something strange. Maybe it's my misunderstanding.

Code:
MediaFileAPI.SetMediaFileMetadata(mf,'ExternalID','EPmt80379S01E02') ;
 println ( "MF ExternalID = " + MediaFileAPI.GetMediaFileMetadata(mf,'ExternalID') ) ;
Result is:
Code:
MF ExternalID =
But: If I go take a look via SageTV Web Interrface, I get this info.
Code:
The Big Bang Theory

Aired: Nov 16, 2011 7:39 PM - 8:00 PM

Duration: 20 m

Rating: TVPG

Category: Comedy - Rerun

Run Time: 30 minutes

Original Air Date: Monday, October 1, 2007

Season 1 Episode 2

Closed Captioned, Stereo

Show ID: EPmt80379S01E02

Starring: Jim Parsons -- Sheldon Cooper [imdb], Johnny Galecki -- Leonard Hofstadter [imdb], Kaley Cuoco -- Penny [imdb], Kunal Nayyar -- Rajesh Koothrappali [imdb], Simon Helberg -- Howard Wolowitz [imdb], Sara Gilbert -- Leslie Winkle [imdb], Kevin Sussman -- Stuart [imdb], Melissa Rauch -- Bernadette Rostenkowski [imdb], Mayim Bialik -- Amy Farrah Fowler [imdb]

Director: Mark Cendrowski [imdb]

Writer: Chuck Lorre [imdb], Bill Prady [imdb], Robert Cohen [imdb], Dave Goetsch [imdb]

Executive Producer: Chuck Lorre [imdb], Bill Prady [imdb]

File Format: MPEG2-PS[MPEG2-Video 4:3 480i@29.97fps, MP2/384Kbps@48kHz Stereo]

Files:
\\TOWER\UnArchived\br\The Big Bang Theory\Season 1\TheBigBangTheory-TheBigBranHypothesis-5910254-0.mpg

File Playlists: [wvx] [m3u] [pls]

Size: 0.67GB

Internal details: MediaFileID=6118855 , AiringID=6379676
I'm totally confused, or don't understand the APIs enough.
Reply With Quote
  #1008  
Old 11-18-2011, 01:55 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
You can't set the external id using the SetMediaFileMetadata(); won't work. However that file appears to have been processed by BMT and should be showing up as a tv recording. If not then whatever is listing it as a movie is buggy because the external id looks good.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #1009  
Old 11-18-2011, 06:41 AM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Quote:
Originally Posted by Slugger View Post
You can't set the external id using the SetMediaFileMetadata(); won't work. However that file appears to have been processed by BMT and should be showing up as a tv recording. If not then whatever is listing it as a movie is buggy because the external id looks good.
OK. so can not Set the ExternalID, but why did the Get show blank?
Reply With Quote
  #1010  
Old 11-18-2011, 07:56 AM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
OK...think I am getting closer as to WHAT is happening, no clue on the WHY.

Attached are logs for another show, before and after the move script and my move/test scripts.
Also got attached the groovy script to show all the metadata in the logs

Was a Sage Recording, after move, shows as Imported Video (not Recording) after the move.
I have not tried BMT on the file yet as I doubt it will make any difference at this point

What appears to be happening is that the MediaFileID changes (I think that is expected) and the AiringID changes (do not think this should be happening)

Before = Internal details: MediaFileID=6379711 , AiringID=5935910
After = Internal details: MediaFileID=6379754 , AiringID=6379758

I did check a file that was moved prior to all these problems occurring and the AiringID matches what is in the filename.

Any help would be greatly appreciated. Going to be in the dog house for awhile after this fiasco.

find_tv_to_archive is a crontask which runs and kicks off another task which is the mv (test & actual move)

Now back to docs to figure out how to change the AiringID for the MediaFiles back to what it should be (to fix the ones with issues currently)

But would be happier if I can fix the issue from happening in the first place
Attached Files
File Type: zip LogFiles.zip (2.7 KB, 137 views)
File Type: zip graywolfsGroovy.zip (4.0 KB, 149 views)
File Type: zip ShowAiringInfo.zip (2.2 KB, 150 views)
Reply With Quote
  #1011  
Old 11-18-2011, 08:09 AM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Quote:
Originally Posted by graywolf View Post
Before = Internal details: MediaFileID=6379711 , AiringID=5935910
After = Internal details: MediaFileID=6379754 , AiringID=6379758
When I asked SageTV support about this (back on version 6 of SageTV) I was told that this should only happen (change in AiringID) when an EPG update changes the ID. SageTV would still associate the media file with the WRONG ID in it to the new AiringID because the file was in the same location as before. But when the file is moved it can no longer keep the match. I asked this question for a plugin I was writing for SageTV V6 but never released because of other complications.
Reply With Quote
  #1012  
Old 11-18-2011, 09:36 AM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Quote:
Originally Posted by BobPhoenix View Post
When I asked SageTV support about this (back on version 6 of SageTV) I was told that this should only happen (change in AiringID) when an EPG update changes the ID. SageTV would still associate the media file with the WRONG ID in it to the new AiringID because the file was in the same location as before. But when the file is moved it can no longer keep the match. I asked this question for a plugin I was writing for SageTV V6 but never released because of other complications.
Well, don't think that is my issue. The attached files were for a recording from midnight-1:00am today. Last EPG update was yesterday 3:17pm. Next EPG Update in 4hrs. 42mins
Reply With Quote
  #1013  
Old 11-18-2011, 10:26 AM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Quote:
Originally Posted by graywolf View Post
Well, don't think that is my issue. The attached files were for a recording from midnight-1:00am today. Last EPG update was yesterday 3:17pm. Next EPG Update in 4hrs. 42mins
I didn't buy it either when told but figured I would put it out there as a possible reason. I could never prove that it wasn't an EPG update because my files were always months old when I had this problem in V6.
Reply With Quote
  #1014  
Old 11-18-2011, 10:56 AM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Making some headway. Got the MediaFile linked to the original AiringID. BUT still not a recording. Any other thoughts on how/what needs to be done to make this a Recording? IsTVFile? = false

Internal details: MediaFileID=6379754 , AiringID=5935910

Code:
MF # of Segments = 1
MF ExternalID = EP011167430385
IsTVFile? = false
Archived? = true
Watched? = false
Don't Like? = false
Not M or F? = true
MediaType = 
Show External ID = EP011167430385
Media File ID = 6379754
AiringID  = 5935910
 
 
AiringAPI info to use for AddAiring
 
ChannelName = FNC
ChannelNumber = 360
AiringDuration = 3600000
AiringEndTime  = 1321596000000
AiringID  = 5935910
AiringPartNumber  = 1
AiringPremiereFinaleInfo  = 
AiringStartTime  = 1321592400000
AiringTitle  = Hannity
AiringTotalParts  = 1
ExtraAiringDetails  = 
LatestWatchedTime  = 1321592400000
ParentalRating  = 
RealWatchedEndTime  = 0
RealWatchedStartTime  = 0
RecordingName  = 
RecordingQuality  = 
ScheduleDuration  = 3600000
ScheduleEndTime  = 1321596000000
ScheduleRecordingRecurrence  = 
ScheduleStartTime  = 1321592400000
TrackNumber  = 0
WatchedDuration  = 0
WatchedEndTime  = 0
WatchedStartTime  = 0
 
ShowAPI info to use for AddShow
 
ShowTitle  = Hannity
IsShowFirstRun = true
ShowEpisode  = Hannity
ShowDescription  = 
ShowDuration  = 0
ShowCategoriesList  = [Talk, News]
PeopleAndCharacterListInShow  = [Sean Hannity]
ShowRated  = 
ShowYear  = 
ShowExternalID  = EP011167430385
ShowLanguage  = 
OriginalAiringDate  = 1321574400000
ShowSeasonNumber  = 0
ShowEpisodeNumber  = 0
Reply With Quote
  #1015  
Old 11-18-2011, 01:04 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
When you move the file and relink it, I think it will not set the tv flag internally, but the file should show up in the list of tv recordings. Also note that when you move the file Sage automatically sets the archived flag, so you may have to adjust your filters in whatever STV you're using to have it show up in the recorded tv listings, but as far as I know, the above file you list should now be a tv recording.

I am using the same scripts to move my stuff to my NAS and it continues to work unmodified (I'm using whatever version is in svn and haven't touched those scripts in months and months).
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #1016  
Old 11-19-2011, 07:24 PM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Thanks for all the suggestions.
None of them seemed to work.

Ended up backing up entire computer, uninstall SageTV, reinstalled SageTV, installed SJQ plugins (for my move scripts) and tested. Worked like a charm again. Added other plugins, had some other configs I had to make (hope I got them all, if not, wife will let me know )

Back in business except for those recordings that were moved during the "bad times", they still show up in videos. Will work with them after taking time away from it.

Next immediate agenda I guess is to setup & test your SJQ backup scripts.

PS. did a couple tests...BMT is updating the messed up ones now so I can get them back as TV Recordings.

Last edited by graywolf; 11-19-2011 at 07:56 PM.
Reply With Quote
  #1017  
Old 11-20-2011, 08:37 AM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Which file do the CRONTAB entries exist?

OK, so I had to redo my SageTV setup. Was able to "save" the tasks by copying over the sjqagent properties file.

Question is, where did the CRONTAB entries reside?

Is there a file I can just copy back from my backup, or do I need to try and remember what I had setup?
Reply With Quote
  #1018  
Old 11-20-2011, 09:54 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by graywolf View Post
OK, so I had to redo my SageTV setup. Was able to "save" the tasks by copying over the sjqagent properties file.

Question is, where did the CRONTAB entries reside?

Is there a file I can just copy back from my backup, or do I need to try and remember what I had setup?
SageTV\plugins\sjq\crontab
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #1019  
Old 11-22-2011, 12:48 PM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
EPG_NoDataCheck.groovy

Modification to Slugger's original code.

BTW - might be good to put either your version or below version into your SJQScripts SVN?

Code:
def CHECK_FAVS = false
def CHECK_CHANS = true
def POST_SYS_MSG = true // If false, just dump the output to stdout
def POST_INFO_MSG = true // If true, post Info msg so you know the script ran. POST_SYS_MSG must be true for this to have any effect
def DaysToCheck = 7    
def now = System.currentTimeMillis()
def output = new StringBuilder()

if(CHECK_FAVS)
    FavoriteAPI.GetFavorites().each {
        if(Database.FilterByRange(FavoriteAPI.GetFavoriteAirings(it), 'GetAiringStartTime', now, Long.MAX_VALUE, true).size() == 0) {
            if(!output.length())
                output.append('The following favourites have no upcoming airings:\n\n')
            output.append("${FavoriteAPI.GetFavoriteDescription(it)}\n")
        }
    }

if(CHECK_CHANS) {
    def preambleWritten = false
    def chans = new HashSet<String>()
    Database.SearchSelectedExactFields('No Data', true, true, false, false, false, false, false, false, false, false, 'T').each {
        def start = AiringAPI.GetAiringStartTime(it)
        if(start > now && start <= now + (86400000L * DaysToCheck) ) {
            def name = AiringAPI.GetAiringChannelName(it)
            def ChannelNumber = AiringAPI.GetAiringChannelNumber(it)
                        if(chans.add(name)) {
                if(!preambleWritten) {
                    output.append("\nThe following channels are missing data within the next $DaysToCheck Days:\n")
                    preambleWritten = true
                }
                output.append("$ChannelNumber - $name\n")
                
            }
        }
    }
}

if(output.length() && !POST_SYS_MSG) {
    println output
} else {
    if(output.length()) {
       SystemMessageAPI.PostSystemMessage(1204, 3, output.toString(), null)
    } else {
       if ( POST_INFO_MSG ) {
          output.append("\nNo channels are missing data within the next $DaysToCheck Days:\n")
          SystemMessageAPI.PostSystemMessage(1204, 1, output.toString(), null)
       }
    }
}
Reply With Quote
  #1020  
Old 11-22-2011, 01:06 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
In order to save me having to do a line by line comparison, can you briefly explain what you changed/fixed with this mod? Thanks.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
Reply


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

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
Plugin: MizookLCD (Alternate SageTV LCDSmartie Plugin) cslatt SageTV Customizations 48 06-11-2012 10:44 AM
SJQv4: Technology Preview Slugger SageTV v7 Customizations 39 12-17-2010 01:17 PM
SageTV Plugin Developers: Any way to see stats for your plugin? mkanet SageTV Software 4 12-12-2010 10:33 PM
MediaPlayer Plugin/STV Import: Winamp Media Player Plugin deria SageTV Customizations 447 12-11-2010 07:38 PM
SJQv4: Design Discussion Slugger SageTV v7 Customizations 26 10-18-2010 08:22 AM


All times are GMT -6. The time now is 01:25 PM.


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