{"id":65,"date":"2005-10-23T15:12:08","date_gmt":"2005-10-23T22:12:08","guid":{"rendered":"http:\/\/outflux.net\/blog\/archives\/2005\/10\/23\/mythtv-original-air-date-visibility\/"},"modified":"2005-10-23T15:19:42","modified_gmt":"2005-10-23T22:19:42","slug":"mythtv-original-air-date-visibility","status":"publish","type":"post","link":"https:\/\/outflux.net\/blog\/archives\/2005\/10\/23\/mythtv-original-air-date-visibility\/","title":{"rendered":"mythtv original air date visibility"},"content":{"rendered":"<p>I have been really unhappy with MythTV&#8217;s visibility of program &#8220;Original Air Date&#8221; information, which as far as I could tell is only visible through the Program Finder.  I wanted to be able to see original air date while I browsed my recordings.  Digging through the MythTV code has proven very difficult.  The documentation has been minimal, and I haven&#8217;t found any tutorials on theme creation, which seems to be where all the visible components of the mythfrontend get their details from.<\/p>\n<p>While looking for the bleeding-edge code, I did find <a href=\"http:\/\/cvs.mythtv.org\/\">http:\/\/cvs.mythtv.org\/<\/a> which is actually a Subversion repository, bug tracker, and wiki.  There a nice start to information there, including <a href=\"http:\/\/www.cuymedia.com\/doxygen-dev-docs\/html\/\">doxygen output<\/a>.  Also, the #mythtv-users channel on freenode has a <a href=\"http:\/\/mythtv.beirdo.ca\/wiki\/\">nice MythTV FAQ<\/a>.<\/p>\n<p>The bulk of the display stuff I was looking from takes place in <code>programs\/mythfrontend\/playbackbox.cpp<\/code> (thank Bryce).  The &#8220;cursorDown&#8221; function led me through to the &#8220;update*&#8221; functions, and eventually ToMap\/SetText calls, which load program information into a hash, and then pass that hash to the theme engine.<\/p>\n<p><code>libs\/libmythtv\/programinfo.cpp<\/code> has ToMap defined, and all the various hash keys are visible, including the original air date variable I was looking for:<\/p>\n<blockquote><p>\nprogMap[&#8220;title&#8221;] = title;<br \/>\nprogMap[&#8220;subtitle&#8221;] = subtitle;<br \/>\nprogMap[&#8220;description&#8221;] = description;<br \/>\n&#8230;<br \/>\nprogMap[&#8220;originalairdate&#8221;]= originalAirDate.toString(dateFormat);\n<\/p><\/blockquote>\n<p>SetText is in <code>libs\/libmyth\/uitypes.cpp<\/code>.  Hash items are uppercased to match %-enclosed words from the themes.  The first &#8220;|&#8221; seen is to identify &#8220;what appears in front&#8221;, and the second is &#8220;what&#8217;s after&#8221;.<\/p>\n<p>I modified the ui.xml from my theme (G.A.N.T. currently) from:<\/p>\n<blockquote><p>\n&nbsp;&nbsp;&lt;value&gt;%SUBTITLE|&#8221;|&#8221;<br \/>\n%%STARS%%DESCRIPTION%&lt;\/value&gt;\n<\/p><\/blockquote>\n<p>to:<\/p>\n<blockquote><p>\n&nbsp;&nbsp;&lt;value&gt;%SUBTITLE|&#8221;|&#8221; %%ORIGINALAIRDATE|(|)<br \/>\n%%STARS%%DESCRIPTION%&lt;\/value&gt;\n<\/p><\/blockquote>\n<p>So now, when I scroll down to Smallville, I see in the description box:<\/p>\n<blockquote><p>&#8220;Aqua&#8221; (2005-10-20)<br \/>\nDuring a beach party Lois hits her head when she jumps into the lake, and &#8230;\n<\/p><\/blockquote>\n<p>Ta-da!  Original Air Date in parens.  Now, being able to see the year is important, so I had to change my date format to one that included the year, but it&#8217;s ugly.  To fix this, I need to actually change code.  In &#8220;MythDateFormat&#8221; from <code>programs\/mythfrontend\/globalsettings.cpp<\/code>, I added:<\/p>\n<blockquote><p>gc-&gt;addSelection(sampdate.toString(&#8220;ddd MMM d, yyyy&#8221;), &#8220;ddd MMM d, yyyy&#8221;);<\/p><\/blockquote>\n<p>Now I just have to <a href=\"http:\/\/www.mythtv.org\/docs\/mythtv-HOWTO-5.html#ss5.4\">get it compiled<\/a>.  :)<\/p>\n<p style='text-align:left'>&copy; 2005, <a href=\"https:\/\/outflux.net\/blog\/\">Kees Cook<\/a>. This work is licensed under a <a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\">Creative Commons Attribution-ShareAlike 4.0 License<\/a>.<br \/><a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\"><img decoding=\"async\" alt=\"CC BY-SA 4.0\" style=\"border-width:0\" src=\"https:\/\/i.creativecommons.org\/l\/by-sa\/4.0\/88x31.png\" \/><\/a> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been really unhappy with MythTV&#8217;s visibility of program &#8220;Original Air Date&#8221; information, which as far as I could tell is only visible through the Program Finder. I wanted to be able to see original air date while I browsed my recordings. Digging through the MythTV code has proven very difficult. The documentation has [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts\/65"}],"collection":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/comments?post=65"}],"version-history":[{"count":0,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts\/65\/revisions"}],"wp:attachment":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/media?parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/categories?post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/tags?post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}