[mythtv] [PATCH]Re: changes to CVS for selecting 'profile'
Geoffrey Hausheer
ou401cru02 at sneakemail.com
Thu Sep 18 23:16:48 EDT 2003
On Thu, 18 Sep 2003 18:54:19 -0700, "Bruce Markey bjm-at-lvcm.com
|mythtv/1.0-Allow|" <2obvhk58d70t at sneakemail.com> said:
> The idea of Default was that anything in the record table
> before mdz added profiles would have "0" in the profile field.
> The Default params would be used for any of these titles with
> unspecified profile values. So, it wasn't hardcoded 480x480
> but whatever is in Default.
Yeah, I know what it is for, but I didn't expect the code the way it is
currently to do that.
>
> > ... (4) given
> > that I'm pressing the right buttons in (3), it just stores 'NULL' in the
> > profile field.
>
> WORKSFORME. I set the first four items on my set rankings page
> to each of the profile names and it did store these strings in
> the database:
Okay, well, the below patch should actually make the profiles work
correctly always. Previously scheduled recordings will record with
'Default' until the profile is edited (because we used to store profiles
as a number, these don't match any profile names). Any time a profile
can't be found, it will use 'Default' now.
.Geoff
-------
Index: libs/libmythtv/tv_rec.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/tv_rec.cpp,v
retrieving revision 1.109
diff -u -r1.109 tv_rec.cpp
--- libs/libmythtv/tv_rec.cpp 18 Sep 2003 21:34:24 -0000 1.109
+++ libs/libmythtv/tv_rec.cpp 19 Sep 2003 03:11:24 -0000
@@ -446,14 +446,23 @@
{
profileName = curRecording->GetScheduledRecording(
db_conn)->getProfileName();
+ bool foundProf = false;
if (profileName != NULL)
+ foundProf = profile.loadByCard(db_conn, profileName,
+ m_capturecardnum);
+ if (!foundProf)
+ {
profileName = QString("Default");
- profile.loadByCard(db_conn, profileName, m_capturecardnum);
+ profile.loadByCard(db_conn, profileName,
m_capturecardnum);
+ }
}
else
{
- profile.loadByCard(db_conn, "Live TV", m_capturecardnum);
+ profileName = QString("Live TV");
+ profile.loadByCard(db_conn, profileName, m_capturecardnum);
}
+ QString msg = QString("Using profile: %1").arg(profileName);
+ VERBOSE(VB_RECORD, msg);
pthread_mutex_unlock(&db_lock);
More information about the mythtv-dev
mailing list