-
Couldn't load subscription status.
- Fork 131
Description
Describe the bug
It crashes when I try to add it to favorites.
To Reproduce
Steps to reproduce the behavior:
- Press 'Shift + O'
- Select 'Radio Station 64'
- Press 'Shift + 8' (to press *, laptop)
- See error:
~ ❯ pyradio
Reading playlist...
Traceback (most recent call last):
File "/usr/bin/pyradio", line 9, in
sys.exit(shell())
^^^^^^^
File "/usr/lib/python3/site-packages/pyradio/main.py", line 1184, in shell
curses.wrapper(pyradio.setup)
File "/usr/lib64/python3.12/curses/init.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/site-packages/pyradio/radio.py", line 1341, in setup
self.run()
File "/usr/lib/python3/site-packages/pyradio/radio.py", line 2260, in run
ret = self.keypress(c) # Handle shortcut
^^^^^^^^^^^^^^^^
File "/usr/lib/python3/site-packages/pyradio/radio.py", line 9771, in keypress
ret, msg = self._cnf.add_to_favorites(self.stations[self.selection])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/site-packages/pyradio/config.py", line 208, in add_to_favorites
return self.favorites.add(an_item)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/site-packages/pyradio/config.py", line 4403, in add
ret = self._write_csv(items)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/site-packages/pyradio/config.py", line 4423, in _write_csv
ret = csv_out.write(items=items)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/site-packages/pyradio/common.py", line 868, in write
writter.writerow(self._format_playlist_row(a_station))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/site-packages/pyradio/common.py", line 834, in _format_playlist_row
this_row[Station.icon] = this_row[Station.icon]['image']
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
TypeError: string indices must be integers, not 'str'
The error only occurs on this station.
Expected behavior
Add to favorites
System (please complete the following information):
- OS: ALT Linux (ALT Sisyphus)
- Python version: 3.12.11
- PyRadio Version: 0.9.3.11.19
- Player used: mpv
Additional context
the station continues playing after an error
