Skip to content

Commit e29b034

Browse files
committed
- updating PyRadio PNG file
- mkvmerge will add a cover image to the file, when chapters are added to it. The file will either be "pyradrio.png" (PyRadio's logo) or "recording.png", a user provided file. Both files should be placed in the "data" folder.
1 parent 0e1d895 commit e29b034

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

devel/pyradio.png

-11.3 KB
Loading

pyradio/player.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3703,6 +3703,19 @@ def write_chapters_to_file_thread(self, input_file):
37033703
opts.extend([
37043704
'--chapters', self._chapters_file,
37053705
])
3706+
t_dir_dir = os.path.dirname(self._output_file)
3707+
for n in (os.path.join(t_dir_dir, 'recording.png'), \
3708+
os.path.join(t_dir_dir, 'pyradio.png')):
3709+
logger.error('looking for: "{}"'.format(n))
3710+
if os.path.exists(n):
3711+
cover_file = n
3712+
break
3713+
if cover_file:
3714+
opts.extend([
3715+
'--attachment-mime-type', 'image/png',
3716+
'--attachment-name', 'cover',
3717+
'--attach-file', cover_file
3718+
])
37063719
opts.extend([
37073720
'-o', self._output_file,
37083721
self._mkv_file

pyradio/schedule_win.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,16 @@ def _dummy_enable(self):
539539
if self._schedule_item.item['type'] == PyRadioScheduleItemType.TYPE_END:
540540
self._widgets[0].string = 'Any playlist'
541541
self._widgets[1].string = 'Any station'
542+
self._widgets[0].enabled = False
543+
self._widgets[1].enabled = False
542544
rec = False
543545
start_fields = False
544546
end_fields = True
545547
else:
546548
self._widgets[0].string = self._schedule_item.item['playlist']
547549
self._widgets[1].string = self._schedule_item.item['station']
550+
self._widgets[0].enabled = True
551+
self._widgets[0].enabled = True
548552
rec = True
549553
start_fields = True
550554
end_fields = True
@@ -785,6 +789,8 @@ def keypress(self, char):
785789
if self._focus == 2:
786790
self._widgets[0].string = self._schedule_item.item['playlist']
787791
self._widgets[1].string = self._schedule_item.item['station']
792+
self._widgets[0].enabled = True
793+
self._widgets[1].enabled = True
788794
elif self._focus == 4:
789795
self._widgets[6].checked = False
790796
elif self._focus == 6:
@@ -797,6 +803,8 @@ def keypress(self, char):
797803
if self._focus == 2:
798804
self._widgets[0].string = 'Any playlist'
799805
self._widgets[1].string = 'Any station'
806+
self._widgets[0].enabled = False
807+
self._widgets[1].enabled = False
800808
elif self._focus == 4:
801809
self._widgets[6].checked = True
802810
elif self._focus == 6:

0 commit comments

Comments
 (0)