Skip to content

Commit 302ba13

Browse files
authored
Merge pull request #74 from kiall/bug/missing-descriptions
Cater for various different EPG summary/descriptions
2 parents e59a4f4 + 691b833 commit 302ba13

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

htsp/src/main/java/ie/macinnes/htsp/messages/BaseEventResponse.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,20 +177,32 @@ public ContentValues toContentValues(long channelId) {
177177
values.put(TvContract.Programs.COLUMN_CHANNEL_ID, channelId);
178178
values.put(TvContract.Programs.COLUMN_INTERNAL_PROVIDER_DATA, mEventId);
179179

180+
// COLUMN_TITLE, COLUMN_EPISODE_TITLE, and COLUMN_SHORT_DESCRIPTION are used in the
181+
// Live Channels app EPG Grid. COLUMN_LONG_DESCRIPTION appears unused.
182+
// On Sony TVs, COLUMN_LONG_DESCRIPTION is used for the "more info" display.
183+
180184
if (!TextUtils.isEmpty(mTitle)) {
185+
// The title of this TV program.
181186
values.put(TvContract.Programs.COLUMN_TITLE, mTitle);
182187
}
183188

184189
if (!TextUtils.isEmpty(mSubTitle)) {
190+
// The episode title of this TV program for episodic TV shows.
185191
values.put(TvContract.Programs.COLUMN_EPISODE_TITLE, mSubTitle);
186192
}
187193

188-
if (!TextUtils.isEmpty(mSummary)) {
194+
if (!TextUtils.isEmpty(mSummary) && !TextUtils.isEmpty(mDescription)) {
195+
// If we have both summary and description... use them both
189196
values.put(TvContract.Programs.COLUMN_SHORT_DESCRIPTION, mSummary);
190-
}
191-
192-
if (!TextUtils.isEmpty(mDescription)) {
193197
values.put(TvContract.Programs.COLUMN_LONG_DESCRIPTION, mDescription);
198+
199+
} else if (!TextUtils.isEmpty(mSummary) && TextUtils.isEmpty(mDescription)) {
200+
// If we have only summary, use it.
201+
values.put(TvContract.Programs.COLUMN_SHORT_DESCRIPTION, mSummary);
202+
203+
} else if (TextUtils.isEmpty(mSummary) && !TextUtils.isEmpty(mDescription)) {
204+
// If we have only description, use it.
205+
values.put(TvContract.Programs.COLUMN_SHORT_DESCRIPTION, mDescription);
194206
}
195207

196208
if (mStart != INVALID_LONG_VALUE) {

0 commit comments

Comments
 (0)