[mythtv] Improving manual recordings

Scott Theisen scott.the.elm at gmail.com
Tue Sep 27 00:04:54 UTC 2022


On 9/26/22 19:20, Steve Erlenborn wrote:
> On 9/24/22 3:55PM, Scott Theisen wrote:
>> Hello all,
>>
>> We primarily use manual recordings due to the poor US OTA EPG data.  
>> There are a few things I would like to change or improve.
>>
>>  1. Restore date/time subtitle if subtitle is empty.
>>       * I will be testing this over the next few days.
>>         https://github.com/MythTV/mythtv/commit/a28191023de31e36efaf23a2d837b4b1725ec73b
>>         claims
>>         https://github.com/MythTV/mythtv/commit/5f6697ecfaf9bd7175aaf99b3ef07f884d5af65c
>>         is at fault for this change.
>>
> *Yes. Please implement this.*

That was easy, a quasi-one line fix:
```
diff --git a/mythtv/programs/mythbackend/scheduler.cpp 
b/mythtv/programs/mythbackend/scheduler.cpp
index 9a1195da42..5d8a529dfc 100644
--- a/mythtv/programs/mythbackend/scheduler.cpp
+++ b/mythtv/programs/mythbackend/scheduler.cpp
@@ -3789,7 +3789,9 @@ void Scheduler::UpdateManuals(uint recordid)
              query.bindValue(":STARTTIME", startdt);
              query.bindValue(":ENDTIME", startdt.addSecs(duration));
              query.bindValue(":TITLE", title);
-            query.bindValue(":SUBTITLE", subtitle);
+            query.bindValue(":SUBTITLE",
+                            !subtitle.isEmpty() ? subtitle :
+                            MythDate::toString(startdt, 
MythDate::kDatabase | MythDate::kOverrideLocal));
              query.bindValue(":DESCRIPTION", description);
              query.bindValue(":SEASON", season);
              query.bindValue(":EPISODE", episode);
```

This annoyed me because manual recordings used to have the date time 
subtitle and I was counting on that for mythlink.pl with just the title 
and subtitle.  It still works with no subtitle, but is not as optimal.

See https://github.com/MythTV/mythtv/pull/643

>
> I'm working on improvements to metadata collection which depend on 
> having the
> date/time populated in the subtitle field when a real subtitle is not 
> available. Normally,
> for Manual Record rules, there is no specified subtitle. The date/time 
> of the start of the
> recording allows me to find a specific season, episode, subtitle, and 
> description, when
> using TVmaze.com for the metadata source. This works for original 
> broadcasts, not
> reruns, because the database only stores the original broadcast date 
> and time. The
> TMDB3 metadata source doesn't support this because its API provides no 
> means to
> find a specific episode based on date/time.
>
> With all the extra information this process provides, I update the 
> season, episode,
> subtitle, and description from such a metadata retrieval, and display 
> them to the
> user in the front end.
>
>>  1. As an option, or entirely, stop appending "(Manual Record)" to
>>     the title of manual recordings.
>>       * This would be easier to stop entirely, but I am open to
>>         keeping it as an option.
>>       * https://github.com/MythTV/mythtv/blob/06da3119d5a35af24df048d300f1240d48d9b3fb/mythtv/libs/libmyth/programinfo.cpp#L818
>>         seems to be to blame for this, in my opinion annoying,
>>         behavior, but I haven't yet tested changing it.
>>       * I would keep the description still with "(Manual Record)".
>>
>
> I have pending code which needs to handle the Description field 
> differently
> for an OTA Automatic Record rule and a Manual Record rule. I currently
> check for "(Manual Record)" in the recording title to distinguish between
> them. If you do remove that substring, then I'd have to find some other
> way to accomplish this. Maybe add some sort of field in the *ProgramInfo*
> class which would indicate that the program originated from a Manual 
> Record
> rule? Maybe the record_id value could be used to search for this 
> information?

I was planning on keeping the description as is so the user can 
distinguish manual recordings.

>
> I worry about a possible name collision in the Record Rules. For one
> show, I have an Automatic Record rule set up for my OTA tuner, and a
> Manual Record Rule set up for my Cable tuner.
>
>     Big Sky
>     Big Sky (Manual Record)
>
> If you eliminate "(Manual Record)", those separate record rules will 
> be harder to
> distinguish. It would still be functional but it would be less clear 
> to the user.
>
>
> Steve Erlenborn

I'll look into David Engel's suggestion of trimming "(Manual Record)" 
from the title instead of modifying the recording rule, as I initially 
suggested.

My initial idea was easy, but appears to not work as well for others:
```
diff --git a/mythtv/libs/libmyth/programinfo.cpp 
b/mythtv/libs/libmyth/programinfo.cpp
index 4d46b9d9f6..adfa8d05b1 100644
--- a/mythtv/libs/libmyth/programinfo.cpp
+++ b/mythtv/libs/libmyth/programinfo.cpp
@@ -815,7 +815,7 @@ ProgramInfo::ProgramInfo(const QString &_title, uint 
_chanid,
              MythDate::toString(m_startTs, MythDate::kTime));
      }

-    m_description = m_title =
+    m_description =
          QString("%1 (%2)").arg(m_title, QObject::tr("Manual Record"));
      ensureSortFields();
  }
```

That ProgramInfo object is then used to construct a RecordingRule in 
mythtv/programs/mythfrontend/manualschedule.cpp 
ManualSchedule::recordClicked().

Regards,

Scott Theisen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-dev/attachments/20220926/885245a1/attachment.htm>


More information about the mythtv-dev mailing list