Add support for episode subtitle and HTML shownotes

This commit is contained in:
Thomas Perl 2014-10-28 14:57:15 +01:00
parent 5e15f13bb3
commit a3fc3fe3c0
4 changed files with 48 additions and 23 deletions

View file

@ -155,6 +155,7 @@ class gPotherSide:
return { return {
'id': episode.id, 'id': episode.id,
'title': episode.trimmed_title, 'title': episode.trimmed_title,
'subtitle': episode.subtitle,
'progress': episode.download_progress(), 'progress': episode.download_progress(),
'downloadState': episode.state, 'downloadState': episode.state,
'isNew': episode.is_new, 'isNew': episode.is_new,
@ -352,7 +353,7 @@ class gPotherSide:
return { return {
'title': episode.trimmed_title, 'title': episode.trimmed_title,
'description': util.remove_html_tags(episode.description), 'description': episode.description_html or episode.description,
'metadata': ' | '.join(self._format_metadata(episode)), 'metadata': ' | '.join(self._format_metadata(episode)),
'link': episode.link if episode.link != episode.url else '', 'link': episode.link if episode.link != episode.url else '',
'chapters': getattr(episode, 'chapters', []), 'chapters': getattr(episode, 'chapters', []),

View file

@ -136,7 +136,7 @@ SlidePage {
font.pixelSize: 30 * pgst.scalef font.pixelSize: 30 * pgst.scalef
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
} }
} }
} }

View file

@ -171,9 +171,7 @@ Item {
color: titleLabel.color color: titleLabel.color
} }
PLabel { Column {
id: titleLabel
anchors { anchors {
left: parent.left left: parent.left
leftMargin: 2 * Constants.layout.padding * pgst.scalef leftMargin: 2 * Constants.layout.padding * pgst.scalef
@ -182,29 +180,54 @@ Item {
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
elide: Text.ElideRight PLabel {
text: title id: titleLabel
color: { anchors {
if (episodeItem.isPlaying) { left: parent.left
return Constants.colors.playback; right: parent.right
} else if (progress > 0) { }
return Constants.colors.download;
} else if (episodeItem.opened) { elide: Text.ElideRight
return Constants.colors.highlight; text: title
} else if (isNew) {
return Constants.colors.fresh; color: {
} else { if (episodeItem.isPlaying) {
return Constants.colors.text; return Constants.colors.playback;
} else if (progress > 0) {
return Constants.colors.download;
} else if (episodeItem.opened) {
return Constants.colors.highlight;
} else if (isNew) {
return Constants.colors.fresh;
} else {
return Constants.colors.text;
}
}
opacity: {
if (downloadState == Constants.state.deleted && !isNew && progress <= 0) {
return 0.3;
} else {
return 1.0;
}
} }
} }
opacity: { PLabel {
if (downloadState == Constants.state.deleted && !isNew && progress <= 0) { id: subtitleLabel
return 0.3;
} else { anchors {
return 1.0; left: titleLabel.left
right: titleLabel.right
} }
text: subtitle
font.pixelSize: 20 * pgst.scalef
visible: subtitle !== ''
elide: Text.ElideRight
opacity: titleLabel.opacity
} }
} }
} }

View file

@ -26,5 +26,6 @@ Text {
font.pixelSize: 30 * pgst.scalef font.pixelSize: 30 * pgst.scalef
font.family: Constants.font font.family: Constants.font
color: Constants.colors.text color: Constants.colors.text
onLinkActivated: Qt.openUrlExternally(link)
} }