"Regular" users, customizing theme for more info

Post Reply
wmorrison
Senior
Posts: 165
Joined: Sat Dec 01, 2018 12:05 am
United States of America

"Regular" users, customizing theme for more info

Post by wmorrison »

I'm not particularly interested in developing a whole theme, but I am in customizing an existing one to show the info I want. If that's you too, here are a few things I've done that you may want to check out.

First make a copy of the theme you like and rename it, then select it. Depending on what you want to modify, you may also have to copy defaultmenu into your user directory at .mythtv/themes/. (/usr/share/mythtv/themes/defaultmenu/)

I'm using Functionality, so if I describe screen locations, it is based on that. I don't know how other themes are laid out.

Basically, I'm recording some old TV series from some stations that broadcast just that (COZI, LAFF, etc.) , and would like to "binge" a season at a time once they're all recorded. On the recordings screen, you can see the season and episode if you select an episode, in the area where the description of the currently selected recording is displayed. If it is a multi-part show, you can see that by pressing 'i' for the info screen.

I wanted to see this information, if it exists, in the list of recordings, to quickly determine if I have a full season to binge. (Still have to look up the total episodes for the season on IMDB or something.)

So I modified recordings-ui.xml.

Find <textarea name="titlesubtitle">. Look at the end of this at the <template>. The original (for Functionality, anyway,) is %TITLESUBTITLE% %YEARSTARS%

Let me just give my new template and then explain it, as best as I can. I could not find documentation on how this works, so I guessed about "optional" fields, but it's working.

<template>%00X00| %%(|PARTNUMBER%%/|PARTTOTAL|) %%TITLESUBTITLE% %YEARSTARS%</template>

Let's break it down.

%00X00% would display season and episode, e.g. 1x01, 1x02, etc. But if you just started the template with "%00X00% %TITLESUBTITLE%" there would always be a space in front of %TITLESUBTITLE% even for non-series recordings. To make the space optional along with season and episode, make it:

%00X00| %

Next, part number and part total.

%(|PARTNUMBER%

Display a left parenthese and the part number, but only if there is a part number.

%/|PARTTOTAL|) %

Display a forward slash, the total parts, a right parenthese, and a trailing space, but only of there is a part total.

Then string it all together with no extra spaces between the %% as the required spaces are part of the optional text.

Looks like:

1x01 (1/2) Subtitle
1x01 (2/2) Subtitle

(It's also possible to have separate episodes and subtitles, i.e. a "to be continued" set originally aired on different dates.)

Note that in the original template, there will always be a space after the TITLESUBTITLE, even if YEARSTARS is blank, but it doesn't matter because there's no text after it to misalign.

Hope somebody finds this useful. The syntax for adding optional spaces and other characters is a bit tricky. If anybody knows where the documentation for this is, I'd appreciate it. Google hasn't found anything yet.
wesnewell
Senior
Posts: 731
Joined: Mon Jun 23, 2014 6:54 pm
Location: Wylie TX, USA
United States of America

Re: "Regular" users, customizing theme for more info

Post by wesnewell »

I would suggest that you add what you want to the end instead of the front. That way the titles will stay aligned.
Might try google for xml programming.
BE/FE-Asrock AB350 Pro Ryzen 3 3200G, 6 atsc tuners. FE's-GF8200's Athlon II, Ryzen 3 2200G. Mythtv user since 2005.
Post Reply