google / sagetv

SageTV is a cross-platform networked DVR and media management system
http://forums.sagetv.com/
Apache License 2.0
265 stars 174 forks source link

How to use EPGDBPublic2.java #472

Closed jzhvymetal closed 2 years ago

jzhvymetal commented 2 years ago

I have a SageTV Java programming question I can not seem to find a an solution. I am trying to update the XMLTV plugin to get it more up to the current standard. The original code is using EPGDBPublic.java which gets the guide from class that implements sage.EPGImportPlugin by defining the following function.

updateGuide(String aProviderId, EPGDBPublic aGuide) https://github.com/google/sagetv/blob/f0e896e70a77e02a06d1ad78e2781f58412db2ba/java/sage/EPGImportPlugin.java#L44

How do use guide that is type EPGDBPublic with EPGDBPublic2 which is and interface that extends EPGDBPublic? (https://github.com/google/sagetv/blob/f0e896e70a77e02a06d1ad78e2781f58412db2ba/java/sage/EPGDBPublic2.java#L22)

jzhvymetal commented 2 years ago

will answer my own question for others

Just cast it. Found studying SageTV base code for good amount of time

this.guide = (EPGDBPublic2) aGuide;