Skip to content

Conversation

@jusjoken
Copy link
Contributor

Fix for lockouts with SD EPG including better handling when run as service and using clients.
Also ensure SD is sent 14 char program ids

//skip the image loading if the bypass properties are set
if(Sage.getBoolean("sdepg_core/bypassCelebrityImages", false) && Sage.getBoolean("sdepg_core/bypassProgramImages", false)){
if (Sage.DBG) System.out.println("MetaImage.loadCacheFile: skipping image load as both bypass properties are set. src = '" + src + "'");
//get the bypass properties
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In SageProperties.java, there's a list there of properties that get sent from the server down to the client, that's the better way to do this rather than invoking server API calls every time the client wants to load an SD image. Then you can just retrieve the property locally w/ no performance hit at all. I know this same GetServerProperty logic appears elsewhere in SD code, but you can leave those alone.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may need some guidance here. I see 2 lists in this source and the 2 are nearly identical in content other than 2 entries...

public static final String[] CLIENT_XFER_PROPERTY_PREFIXES = {
"mmc/video_format_code",

public static final String[] CLIENT_DONT_SAVE_PROPERTY_PREFIXES = {
"mmc/encoders",

All the other entries in these list exist in both lists. So how are these 2 lists used and do I add...

sdepg_core/bypassCelebrityImages
and
sdepg_core/bypassProgramImages

to 1 or both lists.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm curious what I was thinking 20 years ago with some of this...I could have at least commented my own code better...guess I'lll have to dig around. :) So the purpose of the 2 lists at a high level should be somewhat clear. One is for properties that get transferred from the server to the client upon connection. The other is for properties the client shouldn't write out to disk.

The reason for the 2 outliers you found are because 'mmc/encoders' should never actually appear on the client...and there was probably some legacy bug at some point where it did and it caused a problem, so this was an easy way to prevent that from happening again. The 'mmc/video_format_code' is saved on the client because there's a couple UI paths which do different window sizes based on NTSC vs. PAL video formats, and these windows are created before a server connection is established...I'm not sure that affects current code anymore, but it was used to at some point, so it's retained on the client for that reason.

As for the current change, put them in both lists since there's no reason for them to have special treatment. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

public synchronized String getToken()
public synchronized String getToken() throws IOException, SDException
{
if (System.currentTimeMillis()/1000 < tokenExpiration && token != null)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you can just remove this conditional block and always call authenticate() because the first thing that method does is this same check and immediately return if it's true....so having it here as well is just duplicating code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

…rvice and using clients. Also ensure SD is sent 14 char program ids
@jusjoken jusjoken requested a review from Narflex September 20, 2025 12:58
@Narflex Narflex merged commit 8090fdc into google:master Sep 20, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants