SageTV Community  

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

Notices

SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-09-2016, 02:29 PM
davidb's Avatar
davidb davidb is offline
Sage Advanced User
 
Join Date: Feb 2009
Posts: 124
GetSeriesID not working on Sage 9

I have noticed that I am not getting the seriesID back when I am running on Sage 9(9.0.8.429) with Java Version 1.7.0_79. The code I am using is (sorry I don't know how to keep the forum post from formatting the code)

Object files[];
files = MediaFileAPI.GetMediaFiles("DT");
if (files != null)
{
for(int x=0; x < files.length; x++)
{
Object mediafile = files[x];
Object airing = MediaFileAPI.GetMediaFileAiring(mediafile);
Object show = AiringAPI.GetShow(airing);
Object seriesInfo = ShowAPI.GetShowSeriesInfo(show);
if (seriesInfo != null)
{
String seriesID = SeriesInfoAPI.GetSeriesID(seriesInfo);

The seriesID is coming back "0" for every media item when running on Sage 9.
If I run the same code on my older server with Sage 7 then I get the seriesID. I am not sure if its an issue with sagex or with Sagetv.

Thanks!
David

Last edited by davidb; 10-09-2016 at 02:39 PM.
Reply With Quote
  #2  
Old 10-09-2016, 07:23 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by davidb View Post
...sorry I don't know how to keep the forum post from formatting the code...
for future reference, you can enclose the text in between [CODE] [/CODE] tags

Code:
Object files[];
files = MediaFileAPI.GetMediaFiles("DT");
if (files != null) 
{
  for(int x=0; x < files.length; x++)
  {
     Object mediafile = files[x];
     Object airing = MediaFileAPI.GetMediaFileAiring(mediafile);
     Object show = AiringAPI.GetShow(airing);
     Object seriesInfo = ShowAPI.GetShowSeriesInfo(show);
     if (seriesInfo != null)
     {
        String seriesID = SeriesInfoAPI.GetSeriesID(seriesInfo);
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #3  
Old 10-09-2016, 08:06 PM
jusjoken jusjoken is offline
Sage Icon
 
Join Date: Dec 2005
Location: Minneapolis MN
Posts: 2,163
I wonder if this is the same issue i raised back in Feb

here.....

It was not resolved as far as i know but i moved on to other items at the time.

k
Reply With Quote
  #4  
Old 10-10-2016, 06:44 AM
davidb's Avatar
davidb davidb is offline
Sage Advanced User
 
Join Date: Feb 2009
Posts: 124
Yes it sure looks like the same issue! It should be an easy fix as the STV is able to get the seriesID info. I hope someone with more java experience than I can look at it. I am writing most of my server side code in c# and am least comfortable with java.

David

Quote:
Originally Posted by jusjoken View Post
I wonder if this is the same issue i raised back in Feb

here.....

It was not resolved as far as i know but i moved on to other items at the time.

k
Reply With Quote
  #5  
Old 10-10-2016, 07:04 AM
CollegeProject CollegeProject is offline
Sage Advanced User
 
Join Date: Aug 2016
Location: USA
Posts: 119
I am curious about this issue as well. Do you notice that the series id is also not set for the item (like when browsing via BMT) That's what I am noticing. Of course my samples are all imported but I do have guide data and a tuner.

Regardless as a "temp" but messy solution I do this to get the series information

Code:
 public static Object getSetMissingSeries(Object sObj)
        {
        Object rSeries = new Object();
        String mTitle= phoenix.metadata.GetMediaTitle(sObj);
        for(Object series:sagex.api.SeriesInfoAPI.GetAllSeriesInfo())
        {
         String sTitle=sagex.api.SeriesInfoAPI.GetSeriesTitle(series);
         if(sTitle.equals(mTitle))
         {  
         rSeries=series;
         break;
         }
        }
        return rSeries;
        }
}
I think check to make sure my return isn't empty or you could do a null return and check that. It's messy but it works and is fairly quick. I just wish I could find a way to set that series id to the object so I don't have to find it everytime but I have yet found a way to do it.
Reply With Quote
  #6  
Old 10-10-2016, 04:53 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,301
OK, I know what happened here. I've submitted a change to resolve it which shouldn't have any negative impact.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #7  
Old 10-12-2016, 06:51 AM
CollegeProject CollegeProject is offline
Sage Advanced User
 
Join Date: Aug 2016
Location: USA
Posts: 119
Unfortunately mine are still not being set. I am not sure if its BMT or sage. Narflex is there a way to set the id's myself once I find them by looping through?
Reply With Quote
  #8  
Old 10-12-2016, 11:50 AM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,301
Quote:
Originally Posted by CollegeProject View Post
Unfortunately mine are still not being set. I am not sure if its BMT or sage. Narflex is there a way to set the id's myself once I find them by looping through?
No, you can't set the IDs for a SeriesInfo object in the database because it's using those as keys for indexing. If you use the latest code though the GetSeriesID method should be returning non-zero values...is it not?
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #9  
Old 02-25-2018, 07:31 AM
davidb's Avatar
davidb davidb is offline
Sage Advanced User
 
Join Date: Feb 2009
Posts: 124
I am currently using SageTV version 9.1.5.683 and still using the code in the first message to get the SeriesID. My current sagetv has 30 episodes of the Hallmark channel "When Calls the Heart" series and the stv is grouping them all together. However when I run the above code I am getting 27 episodes with one SeriesID and 3 episodes with another SeriesID. I am using the SeriesID for my app to group series epiosodes together. Both seriesID's are greater than 0. Any idea if it's an issue on my code or is this an issue on the sagetv side?

Thanks
David
Reply With Quote
  #10  
Old 02-25-2018, 12:39 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,538
Quote:
Originally Posted by davidb View Post
I am currently using SageTV version 9.1.5.683 and still using the code in the first message to get the SeriesID. My current sagetv has 30 episodes of the Hallmark channel "When Calls the Heart" series and the stv is grouping them all together. However when I run the above code I am getting 27 episodes with one SeriesID and 3 episodes with another SeriesID. I am using the SeriesID for my app to group series epiosodes together. Both seriesID's are greater than 0. Any idea if it's an issue on my code or is this an issue on the sagetv side?

Thanks
David
I know for phoenix when we group by series, we are actually grouping the media title (ie, the show name). We don't use the seriesinfo id.
Reply With Quote
  #11  
Old 03-05-2018, 07:05 PM
EnterNoEscape's Avatar
EnterNoEscape EnterNoEscape is offline
Sage Icon
 
Join Date: Jun 2010
Location: Harrisburg, PA
Posts: 2,491
Quote:
Originally Posted by Narflex View Post
No, you can't set the IDs for a SeriesInfo object in the database because it's using those as keys for indexing. If you use the latest code though the GetSeriesID method should be returning non-zero values...is it not?
That's not always going to be true since we don't get any information from Schedules Direct in this area. What I have to work with isn't consistent, so you might have an ID at some point in time, but we might not have enough to work with at a later date and the ID ends up being 0.

Edit: The code doesn't go into the Wizard to see if a SeriesInfo entry already exists, so that could be an improvement I guess.
__________________
SageTV v9 Server: ASRock Z97 Extreme4, Intel i7-4790K @ 4.4Ghz, 32GB RAM, 8x 3TB 7200rpm HD, 2x 5TB 7200rpm HD, 4x 256GB SSD, 4x 500GB SSD, unRAID Pro 6.3.0-rc6 (Dual Parity + SSD Cache).
Capture: 1x Ceton InfiniTV 4 (ClearQAM), 2x Ceton InfiniTV 6, 1x BM1000-HDMI, 1x BM3500-HDMI.

Clients: 1x HD300 (Living Room), 1x HD200 (Master Bedroom).
Software: OpenDCT :: WMC Live TV Tuner :: Schedules Direct EPG

Last edited by EnterNoEscape; 03-05-2018 at 07:07 PM.
Reply With Quote
  #12  
Old 03-06-2018, 07:46 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,538
Quote:
Originally Posted by EnterNoEscape View Post
That's not always going to be true since we don't get any information from Schedules Direct in this area. What I have to work with isn't consistent, so you might have an ID at some point in time, but we might not have enough to work with at a later date and the ID ends up being 0.

Edit: The code doesn't go into the Wizard to see if a SeriesInfo entry already exists, so that could be an improvement I guess.
I do that phoenix/bmt when adding a new series... ie, I find a series with the same name ans use it, otherwise I add a new one.
Reply With Quote
  #13  
Old 03-07-2018, 08:00 AM
davidb's Avatar
davidb davidb is offline
Sage Advanced User
 
Join Date: Feb 2009
Posts: 124
I am not sure if the problems I was having with GetSeriesID had to do with the fact that some episodes were recorded with sage7 with the sage epg and some with the sage9 with schedules direct.

I gave up on using GetSeriesID as I was getting one non zero seriesID for 27 episodes and a different non zero seriesID for 3 episodes. Thanks to a private message from EnterNoEscape I am now using the ShowExternalID. It will return a value like "EP015474730074". I strip off the first two left most characters "EP" and then convert to an integer. This is what appears to be a unique number for the series and the 4 least significant digits the episode number. I take that number and and with with 0xffff to get the episode number. Next I right shift by 4 to get a unique number for the series.
Reply With Quote
  #14  
Old 03-07-2018, 06:08 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,301
Quote:
Originally Posted by davidb View Post
I gave up on using GetSeriesID as I was getting one non zero seriesID for 27 episodes and a different non zero seriesID for 3 episodes. Thanks to a private message from EnterNoEscape I am now using the ShowExternalID. It will return a value like "EP015474730074". I strip off the first two left most characters "EP" and then convert to an integer. This is what appears to be a unique number for the series and the 4 least significant digits the episode number. I take that number and and with with 0xffff to get the episode number. Next I right shift by 4 to get a unique number for the series.
That works some of the time...it's pretty good for an overall approximation though. Unfortunately I can't remember right now when this doesn't work.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #15  
Old 03-11-2018, 06:47 PM
EnterNoEscape's Avatar
EnterNoEscape EnterNoEscape is offline
Sage Icon
 
Join Date: Jun 2010
Location: Harrisburg, PA
Posts: 2,491
Quote:
Originally Posted by Narflex View Post
That works some of the time...it's pretty good for an overall approximation though. Unfortunately I can't remember right now when this doesn't work.
If it comes back to you, I would really like to know under what circumstances this doesn't work. The only thought I have is if the series has more than one "ID" which I guess could happen if they reach 9999 episodes?
__________________
SageTV v9 Server: ASRock Z97 Extreme4, Intel i7-4790K @ 4.4Ghz, 32GB RAM, 8x 3TB 7200rpm HD, 2x 5TB 7200rpm HD, 4x 256GB SSD, 4x 500GB SSD, unRAID Pro 6.3.0-rc6 (Dual Parity + SSD Cache).
Capture: 1x Ceton InfiniTV 4 (ClearQAM), 2x Ceton InfiniTV 6, 1x BM1000-HDMI, 1x BM3500-HDMI.

Clients: 1x HD300 (Living Room), 1x HD200 (Master Bedroom).
Software: OpenDCT :: WMC Live TV Tuner :: Schedules Direct EPG
Reply With Quote
  #16  
Old 03-13-2018, 07:55 AM
davidb's Avatar
davidb davidb is offline
Sage Advanced User
 
Join Date: Feb 2009
Posts: 124
I have reworked my code to use the ShowExternalID as described a few posts above as a "seriesID" and now all of my shows are grouping properly. The frustrating thing was GetSeriesID was so "close" to right but ShowExternalID worked for me in grouping all of my episodes in a series. To anyone lurking BEWARE if you use GetSeriesID to "attempt" to group all episodes for a series!
I am not sure if the api docs are auto generated or if there is a way to put a note about this in the GetSeriesID or not.

David

Quote:
Originally Posted by Narflex View Post
That works some of the time...it's pretty good for an overall approximation though. Unfortunately I can't remember right now when this doesn't work.
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
SAGE DCT x64 2.2.0 is not working mguebert Hardware Support 6 03-30-2012 06:36 PM
Sage just isn't working out for me.. meep SageTV Software 23 01-17-2009 05:47 PM
ATI HDTV Wonder Not Working w/ Sage jsidlosky SageTV Beta Test Software 1 10-02-2005 10:04 PM
Sage TV listings not working? jkaisre SageTV EPG Service 5 10-04-2003 05:25 PM
dtv to sage not working IKK SageTV Software 1 08-02-2003 05:01 AM


All times are GMT -6. The time now is 05:10 PM.


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