SageTV Community  

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

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 09-15-2015, 02:41 PM
rkulagow's Avatar
rkulagow rkulagow is offline
Sage Advanced User
 
Join Date: Feb 2013
Posts: 157
stationID: string or integer?

I'm going to be adding test data for Australia shortly to gauge user interest in feeds for AU and NZ.

However, there's a collision between the existing stationID values and the ones that I would have for those countries. In the API for the JSON service, stationID has always been sent as a string.

Does Sage / the Open Source grabber maintain that stringification? If yes, then I will be able to use "AU18294" and "18294" to make sure that on the server those are unique schedule entities so that I don't need to maintain multiple databases.

If no, then the grabber may need to strip the first two characters if they're not digits (because it's unlikely that a user will is going to use both AU data _and_ data for anywhere else that we currently have lineups and schedules.)
Reply With Quote
  #2  
Old 09-15-2015, 02:55 PM
wnjj wnjj is offline
Sage Icon
 
Join Date: Jan 2009
Posts: 1,514
Looks like int in Channel.java:

Code:
    stationID = in.readInt();
Reply With Quote
  #3  
Old 09-15-2015, 03:33 PM
jamesdisco's Avatar
jamesdisco jamesdisco is offline
Sage Advanced User
 
Join Date: Jul 2008
Location: N Yorks, UK
Posts: 234
Do you think you might look at doing UK data
__________________
Server: Win 10 64bit Core i3 8GB 20TB, TBS6985, TBS6984, Sage 9.
Clients: 5 x HD300, 2 x HD200, Placeshifter.
Reply With Quote
  #4  
Old 09-15-2015, 04:59 PM
rkulagow's Avatar
rkulagow rkulagow is offline
Sage Advanced User
 
Join Date: Feb 2013
Posts: 157
We've had UK data for quite a while on the JSON service. If you PM me your postal code I can let you know which lineups we have and a sample of the data.

Unless the grabber is hardcoded for US/Canada?
Reply With Quote
  #5  
Old 09-15-2015, 07:04 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
It should work with any country so long as the raw json data is in the same format as US/Canada.

It will definitely not work with any data where the stationid contains non-numeric characters. The Sage client to the data assumes that Interger.parseInt(airing.stationid) will "just work". If that doesn't, boom goes the dynamite.
__________________
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
  #6  
Old 09-15-2015, 07:21 PM
rkulagow's Avatar
rkulagow rkulagow is offline
Sage Advanced User
 
Join Date: Feb 2013
Posts: 157
Good to know; I've asked a few other consumers of the JSON data, and they all treat the stationID as a string; Sage seems to be the exception, so if AU/NZ data moves forward then it may be something where the grabber needs to add/remove "AU" or "NZ" prior to sending the request so that it can continue to treat the remainder as an integer.
Reply With Quote
  #7  
Old 09-16-2015, 12:30 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
Modifying the SageTV internals so that stationID is a String would not be all that complex to do.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #8  
Old 09-16-2015, 02:56 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by Narflex View Post
Modifying the SageTV internals so that stationID is a String would not be all that complex to do.
Likely the biggest issue would be dealing with the wiz.bin, as I'm guessing StationID is there in the Airings, right?
__________________
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
  #9  
Old 09-16-2015, 04:22 PM
wnjj wnjj is offline
Sage Icon
 
Join Date: Jan 2009
Posts: 1,514
Quote:
Originally Posted by Fuzzy View Post
Likely the biggest issue would be dealing with the wiz.bin, as I'm guessing StationID is there in the Airings, right?
It's in Channel at a minimum. The snippet I posted is from the wiz.bin reading code.
Reply With Quote
  #10  
Old 09-17-2015, 12:26 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
If there's going to be a limited number of String prefixes on stationIDs; then I'd just recommend creating a mapping of them to some higher values. So for example if it's AU12345, then map AU to be 100000000 and this one becomes 100012345. StationIDs are stored in 32 bit integers...so there's plenty of extra room in that field to encode a set of 2 character prefixes.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #11  
Old 09-17-2015, 06:15 PM
Tiki's Avatar
Tiki Tiki is offline
Sage Icon
 
Join Date: Feb 2005
Location: Southwest Florida, USA
Posts: 2,009
Quote:
Originally Posted by Narflex View Post
If there's going to be a limited number of String prefixes on stationIDs; then I'd just recommend creating a mapping of them to some higher values. So for example if it's AU12345, then map AU to be 100000000 and this one becomes 100012345. StationIDs are stored in 32 bit integers...so there's plenty of extra room in that field to encode a set of 2 character prefixes.
If the string portion is always 2 letters, you could even consider doing an ascii to int conversion (A = 65, U = 85). This would support future codes without needing more mapping, the downside is it is more limited in the maximum number of characters that would fit into a 32-bit integer (so you might get into trouble if some of the string prefixes were longer than 2 characters).
__________________
Server: Ryzen 2400G with integrated graphics, ASRock X470 Taichi Motherboard, HDMI output to Vizio 1080p LCD, Win10-64Bit (Professional), 16GB RAM
Capture Devices (7 tuners): Colossus (x1), HDHR Prime (x2)
,USBUIRT (multi-zone)
Source:
Comcast/Xfinity X1 Cable
Primary Client: Server Other Clients: (1) HD200, (1) HD300
Retired Equipment: MediaMVP, PVR150 (x2), PVR150MCE,
HDHR, HVR-2250, HD-PVR
Reply With Quote
  #12  
Old 09-17-2015, 07:20 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by Tiki View Post
If the string portion is always 2 letters, you could even consider doing an ascii to int conversion (A = 65, U = 85). This would support future codes without needing more mapping, the downside is it is more limited in the maximum number of characters that would fit into a 32-bit integer (so you might get into trouble if some of the string prefixes were longer than 2 characters).
Since the prefixes are likely all country codes, they could also be converted to 3166-1 numeric codes, which are 3 digit (0-999).
__________________
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
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
How to shorten a string? tmiranda SageTV Studio 6 10-10-2009 09:59 AM
What is the best way to get the width in pixels of a string? BobPhoenix SageTV Studio 4 12-16-2007 02:56 AM
Studio String help evilpenguin SageTV Studio 1 06-10-2006 08:55 PM
OK to string tv splitters/boosters together? jimbobuk General Discussion 5 05-16-2003 10:01 AM


All times are GMT -6. The time now is 02:12 AM.


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