Graphical front panel display

It did the trick my cmdline.txt contained several lines. Thank for the hint :slight_smile:

Il also worked on PVR detection, the following code will detect recorded TV, live TV, tv show (library) and movies

# if enabled via settings.
if VIDEO_LAYOUT_AUTOSELECT:
    if info["Player.Filenameandpath"].startswith("pvr://recordings"):
        layout = VIDEO_LAYOUT["V_PVR"]     # PVR TV shows
    elif info["Player.Filenameandpath"].startswith("pvr://channels"):
        layout = VIDEO_LAYOUT["V_LIVETV"]     # live TV
    elif info["VideoPlayer.TVShowTitle"] != '':
        layout = VIDEO_LAYOUT["V_TV_SHOW"] # Library TV shows
    elif info["VideoPlayer.OriginalTitle"] != '':
        layout = VIDEO_LAYOUT["V_movie"] # movie
    else:
        pass  # leave as-is, assumed good for other type (file, addon, musicvideo, etc)

Of course corresponding video layout have to be defined and needed infolabel to be retrieved.

I also made a specific progress bar calculation for PVR to eliminate the start and stop offset of the PVR (my PVR start/stop the recording 10min before/after the actual program schedule)

def calc_progress_pvr(time_str, duration_str):
if (time_str == “” or duration_str == “”):
return -1
if not (1 <= time_str.count(“:”) <= 2 and
1 <= duration_str.count(“:”) <= 2):
return -1

cur_secs   = sum(int(x) * 60 ** i for i, x in enumerate(reversed(time_str.split(':')))) - 600 #remove pvr start offset
total_secs = sum(int(x) * 60 ** i for i, x in enumerate(reversed(duration_str.split(':')))) -1200 #remove pvr start and stop offsets
if (total_secs > 0 and cur_secs > 0 and cur_secs <= total_secs): #recording finished, show progress bar
    return cur_secs/total_secs
if (cur_secs < 0 or total_secs < 0 ): #recording just started, hide progress bar
    return -1
if (cur_secs >= total_secs): #recording ongoing show full progress bar (100%)
    return 1
else:
    return -1

And you have to specify when you want to use it:

    try:
        video_info = response['result']

        # See remarks in audio_screens() regarding calc_progress()
        if video_info["Player.Filenameandpath"].startswith("pvr://recordings"):
                    prog = calc_progress_pvr(video_info["VideoPlayer.Time"], video_info["VideoPlayer.Duration"])
        else:
                   prog = calc_progress(video_info["VideoPlayer.Time"], video_info["VideoPlayer.Duration"])