Fix subtitle display in episode list
This commit is contained in:
parent
4dc489597a
commit
a03ede77f4
2 changed files with 7 additions and 1 deletions
7
main.py
7
main.py
|
@ -148,13 +148,18 @@ class gPotherSide:
|
||||||
podcasts = self._get_podcasts_sorted()
|
podcasts = self._get_podcasts_sorted()
|
||||||
return [self.convert_podcast(podcast) for podcast in podcasts]
|
return [self.convert_podcast(podcast) for podcast in podcasts]
|
||||||
|
|
||||||
|
def _get_subtitle(self, episode):
|
||||||
|
for line in util.remove_html_tags(episode.subtitle).strip().splitlines():
|
||||||
|
return line
|
||||||
|
return ''
|
||||||
|
|
||||||
def convert_episode(self, episode):
|
def convert_episode(self, episode):
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
tnow = time.time()
|
tnow = time.time()
|
||||||
return {
|
return {
|
||||||
'id': episode.id,
|
'id': episode.id,
|
||||||
'title': episode.trimmed_title,
|
'title': episode.trimmed_title,
|
||||||
'subtitle': episode.subtitle,
|
'subtitle': self._get_subtitle(episode),
|
||||||
'progress': episode.download_progress(),
|
'progress': episode.download_progress(),
|
||||||
'downloadState': episode.state,
|
'downloadState': episode.state,
|
||||||
'isNew': episode.is_new,
|
'isNew': episode.is_new,
|
||||||
|
|
|
@ -231,6 +231,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
text: subtitle
|
text: subtitle
|
||||||
|
textFormat: Text.PlainText
|
||||||
font.pixelSize: 20 * pgst.scalef
|
font.pixelSize: 20 * pgst.scalef
|
||||||
|
|
||||||
visible: subtitle !== ''
|
visible: subtitle !== ''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue