Skip to content

Commit be61272

Browse files
committed
- Version 0.8.9.5 (0.9-beta2)
- Fixed a crash that would occur when searching for name only in RadioBrowser Search Window - Do not display the Theme Selection Window when pressing "t" in a RadioBrowser Line Editor - Updated History legend area - Updated docs
1 parent 6c85f91 commit be61272

File tree

6 files changed

+75
-42
lines changed

6 files changed

+75
-42
lines changed

Changelog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2021-08-11
2+
* Version 0.8.9.5 (0.9-beta2)
3+
* Fixed a crash that would occur when searching for name only in
4+
RadioBrowser Search Window
5+
* Do not display the Theme Selection Window when pressing "t" in a
6+
RadioBrowser Line Editor
7+
* Updated History legend aread
8+
* Updated docs
9+
110
2021-08-11
211
* Version 0.8.9.4 (0.9-beta1)
312
* Radio Browser implementation is now usable (but still not complete)

README.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ <h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><
8686
<li><a href="#using-transparency">Using transparency</a></li>
8787
</ul></li>
8888
<li><a href="#mouse-support">Mouse support</a></li>
89+
<li><a href="#online-radio-directory-services">Online radio directory services</a></li>
8990
<li><a href="#session-locking">Session Locking</a>
9091
<ul>
9192
<li><a href="#session-unlocking">Session unlocking</a></li>
@@ -96,7 +97,6 @@ <h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><
9697
</ul></li>
9798
<li><a href="#cleaning-up">Cleaning up</a></li>
9899
<li><a href="#debug-mode">Debug mode</a></li>
99-
<li><a href="#online-radio-directory-services">Online radio directory services</a></li>
100100
<li><a href="#reporting-bugs">Reporting bugs</a></li>
101101
<li><a href="#packaging-pyradio">Packaging PyRadio</a></li>
102102
<li><a href="#todo">TODO</a></li>
@@ -550,6 +550,14 @@ <h2 id="mouse-support">Mouse support <span style="padding-left: 10px;"><sup styl
550550
</tr>
551551
</tbody>
552552
</table>
553+
<h2 id="online-radio-directory-services">Online radio directory services <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
554+
<p><strong>PyRadio</strong> supports the following <em>Online radio directory services</em>:</p>
555+
<ul>
556+
<li><a target="_blank" href="https://www.radio-browser.info/">RadioBrowser</a></p>
557+
<p>This is a community driven effort (like wikipedia) with the aim of collecting as many internet radio and TV stations as possible.</p>
558+
<p>Read more at <a href="radio-browser.html">PyRadio RadioBrowser Implementation</a></p></li>
559+
</ul>
560+
<p>To access supported services, just press “<strong>O</strong>” (capital “<em>o</em>”) at the program’s main window.</p>
553561
<h2 id="session-locking">Session Locking <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
554562
<p><strong>PyRadio</strong> uses session locking, which actually means that only the first instance executed within a given session will be able to write to the configuration file.</p>
555563
<p>Subsequent instances will be “<em>locked</em>”. This means that the user can still play stations, load and edit playlists, load and test themes, but any changes will <strong>not</strong> be recorded in the configuration file.</p>
@@ -573,14 +581,6 @@ <h2 id="cleaning-up">Cleaning up <span style="padding-left: 10px;"><sup style="f
573581
<h2 id="debug-mode">Debug mode <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
574582
<p>Adding the “<strong>-d</strong>” option to the command line will instruct <strong>PyRadio</strong> to enter <em>Debug mode</em>, which means that it will print debug messages to a file. This file will always reside in the user’s home directory and will be named <em>pyradio.log</em>.</p>
575583
<p>In case of a bug or a glitch, please include this file to the issue you will <a target="_blank" href="https://github.com/coderholic/pyradio/issues">open at github</a>.</p>
576-
<h2 id="online-radio-directory-services">Online radio directory services <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
577-
<p><strong>PyRadio</strong> supports the following <em>Online radio directory services</em>:</p>
578-
<ul>
579-
<li><a target="_blank" href="https://www.radio-browser.info/">RadioBrowser</a></p>
580-
<p>This is a community driven effort (like wikipedia) with the aim of collecting as many internet radio and TV stations as possible.</p>
581-
<p>Read more at <a href="radio-browser.html">PyRadio RadioBrowser Implementation</a></p></li>
582-
</ul>
583-
<p>To access supported services, just press “<strong>O</strong>” (capital “<em>o</em>”) at the program’s main window.</p>
584584
<h2 id="reporting-bugs">Reporting bugs <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></style></h2>
585585
<p>When a bug is found, please do report it by <a target="_blank" href="https://github.com/coderholic/pyradio/issues">opening an issue at github</a>, as already stated above.</p>
586586
<p>In you report you should, at the very least, state your <strong>pyradio version</strong>, <strong>python version</strong> and <strong>method</strong> of installation (built from source, AUR, snap, whatever).</p>

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ Ben Dowling - [https://github.com/coderholic](https://github.com/coderholic)
4141
* [PyRadio Themes](#pyradio-themes)
4242
* [Using transparency](#using-transparency)
4343
* [Mouse support](#mouse-support)
44+
* [Online radio directory services](#online-radio-directory-services)
4445
* [Session Locking](#session-locking)
4546
* [Session unlocking](#session-unlocking)
4647
* [Update notification](#update-notification)
4748
* [Updating a pre 0.8.9 installation](#updating-a-pre-0.8.9-installation)
4849
* [Cleaning up](#cleaning-up)
4950
* [Debug mode](#debug-mode)
50-
* [Online radio directory services](#online-radio-directory-services)
5151
* [Reporting bugs](#reporting-bugs)
5252
* [Packaging PyRadio](#packaging-pyradio)
5353
* [TODO](#todo)
@@ -669,6 +669,18 @@ Then, the mouse can be used as follows:
669669
| **Wheel** | Scroll up / down |
670670
| **Shift-Wheel** | Adjust volume<br>(does not work with all terminals) |
671671

672+
## Online radio directory services
673+
674+
**PyRadio** supports the following *Online radio directory services*:
675+
676+
- [RadioBrowser](https://www.radio-browser.info/)
677+
678+
This is a community driven effort (like wikipedia) with the aim of collecting as many internet radio and TV stations as possible.
679+
680+
Read more at [PyRadio RadioBrowser Implementation](radio-browser.md)
681+
682+
To access supported services, just press "**O**" (capital "*o*") at the program's main window.
683+
672684
## Session Locking
673685

674686
**PyRadio** uses session locking, which actually means that only the first instance executed within a given session will be able to write to the configuration file.
@@ -713,18 +725,6 @@ Adding the "**-d**" option to the command line will instruct **PyRadio** to ente
713725

714726
In case of a bug or a glitch, please include this file to the issue you will [open at github](https://github.com/coderholic/pyradio/issues).
715727

716-
## Online radio directory services
717-
718-
**PyRadio** supports the following *Online radio directory services*:
719-
720-
- [RadioBrowser](https://www.radio-browser.info/)
721-
722-
This is a community driven effort (like wikipedia) with the aim of collecting as many internet radio and TV stations as possible.
723-
724-
Read more at [PyRadio RadioBrowser Implementation](radio-browser.md)
725-
726-
To access supported services, just press "**O**" (capital "*o*") at the program's main window.
727-
728728
## Reporting bugs
729729

730730
When a bug is found, please do report it by [opening an issue at github](https://github.com/coderholic/pyradio/issues), as already stated above.

pyradio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" pyradio -- Console radio player. "
22

3-
version_info = (0, 8, 9, 4)
3+
version_info = (0, 8, 9, 5)
44

55
# Application state:
66
# New stable version: ''

pyradio/browser.py

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737

3838
RADIO_BROWSER_SEARCH_BY_TERMS = {
3939
'byuuid': -1,
40-
'byname': 5,
41-
'bynameexact': 5,
40+
'byname': 6,
41+
'bynameexact': 6,
4242
'bycodec': 16,
4343
'bycodecexact': 16,
4444
'bycountry': 8,
@@ -306,6 +306,12 @@ class RadioBrowserInfo(PyRadioStationsBrowser):
306306

307307
keyboard_handler = None
308308

309+
''' _search_history_index - current item in this browser - corresponds to search window _history_id
310+
_search_default_history_index - autoload item in this browser - corresponds to search window _default_history_id
311+
'''
312+
_search_history_index = 1
313+
_search_default_history_index = 1
314+
309315
def __init__(self,
310316
config,
311317
config_encoding,
@@ -361,8 +367,8 @@ def initialize(self):
361367
})
362368

363369
# self._search_history.append({
364-
# 'type': 'bytagexact',
365-
# 'term': 'jpop',
370+
# 'type': 'bytag',
371+
# 'term': 'big band',
366372
# 'post_data': {'order': 'votes', 'reverse': 'true'},
367373
# })
368374

@@ -1257,7 +1263,10 @@ def do_search(self, parent=None, init=False):
12571263
limit=self._default_max_number_of_results,
12581264
init=init
12591265
)
1260-
self._search_win.set_search_history(self._search_history_index, self._search_history, init)
1266+
self._search_win.set_search_history(
1267+
self._search_default_history_index,
1268+
self._search_history_index,
1269+
self._search_history, init)
12611270
self.keyboard_handler = self._search_win
12621271
self._search_win.show()
12631272

@@ -1325,7 +1334,11 @@ class RadioBrowserInfoSearchWindow(object):
13251334

13261335
_default_limit = 100
13271336

1328-
_history_id = _selected_history_id = 0
1337+
''' _selected_history_id : current id in search window
1338+
_history_id : current id (active in browser) - corresponds in browser to _search_history_index
1339+
_default_history_id : default id (autoload for service) - corresponds in browser to _search_default_history_index
1340+
'''
1341+
_history_id = _selected_history_id = _default_history_id = 1
13291342
_history = []
13301343

13311344
def __init__(self,
@@ -1501,10 +1514,11 @@ def _widgets_to_search_term(self):
15011514

15021515
if len(what_type) == 1:
15031516
''' simple search '''
1504-
# logger.error('DE simple search')
1517+
logger.error('DE simple search')
15051518
for n in RADIO_BROWSER_SEARCH_BY_TERMS.items():
15061519
if n[1] == what_type[0]:
15071520
ret['type'] = n [0]
1521+
logger.error('DE type = {}'.format(ret['type']))
15081522
break
15091523
if self._widgets[what_type[0] - 1].checked:
15101524
ret['type'] += 'exact'
@@ -1557,6 +1571,7 @@ def get_history(self):
15571571

15581572
def set_search_history(
15591573
self,
1574+
main_window_default_search_history_index,
15601575
main_window_search_history_index,
15611576
main_window_search_history,
15621577
init=False
@@ -1567,6 +1582,7 @@ def set_search_history(
15671582
'''
15681583
self._history_id = main_window_search_history_index
15691584
if init:
1585+
self._default_history_id = main_window_default_search_history_index
15701586
self._selected_history_id = main_window_search_history_index
15711587
logger.error('DE set_search_history - _selected_history_id={}'.format(self._selected_history_id))
15721588
self._history = deepcopy(main_window_search_history)
@@ -1816,7 +1832,7 @@ def show(self):
18161832
self._win.refresh()
18171833
self._calculate_widgets_yx(Y, X)
18181834
# logger.error('== 1 widget[{0}].Y = {1}'.format(3, self._widgets[3].Y))
1819-
for n in range(0,6):
1835+
for n in range(0,5):
18201836
''' place editors' captions '''
18211837
# self._win.addstr(
18221838
# self.yx[n+1][0],
@@ -1850,17 +1866,24 @@ def show(self):
18501866

18511867
# logger.error('== 2 widget[{0}].Y = {1}'.format(3, self._widgets[3].Y))
18521868
self._h_buttons.calculate_buttons_position()
1853-
self._print_history_legent()
1869+
self._print_history_legend()
18541870
self._display_all_widgets()
18551871

1856-
def _print_history_legent(self):
1872+
def _print_history_legend(self):
18571873
self._win.addstr(self.maxY - 2, 2 , 'History item: ')
18581874
self._win.addstr('{}'.format(self._selected_history_id), curses.color_pair(4))
18591875
self._win.addstr('/{} '.format(len(self._history)-1))
1860-
if self._selected_history_id == self._history_id:
1861-
self._win.addstr(self.maxY - 3, 2, 'Item in Browser', curses.color_pair(4))
1862-
else:
1863-
self._win.addstr(self.maxY - 3, 2, 25 * ' ')
1876+
1877+
self._win.addstr(self.maxY - 3, 2, 25 * ' ')
1878+
if self._selected_history_id == 0:
1879+
self._win.addstr(self.maxY - 3, 2, 'Template!!!', curses.color_pair(4))
1880+
elif self._selected_history_id == self._history_id:
1881+
if self._default_history_id == self._history_id:
1882+
self._win.addstr(self.maxY - 3, 2, 'Item in Browser, Default', curses.color_pair(4))
1883+
else:
1884+
self._win.addstr(self.maxY - 3, 2, 'Item in Browser', curses.color_pair(4))
1885+
elif self._selected_history_id == self._default_history_id:
1886+
self._win.addstr(self.maxY - 3, 2, 'Default item', curses.color_pair(4))
18641887

18651888
msg = 'History navigation: ^N/^P, Go to empty item: ^Y'
18661889
thisX = self.maxX - 2 - len(msg)
@@ -1987,7 +2010,7 @@ def keypress(self, char):
19872010
self._selected_history_id += 1
19882011
if self._selected_history_id >= len(self._history):
19892012
self._selected_history_id = 0
1990-
self._print_history_legent()
2013+
self._print_history_legend()
19912014
self._activate_search_term(self._history[self._selected_history_id])
19922015

19932016
elif char in (curses.ascii.DLE, ):
@@ -1996,7 +2019,7 @@ def keypress(self, char):
19962019
self._selected_history_id -= 1
19972020
if self._selected_history_id <0:
19982021
self._selected_history_id = len(self._history) - 1
1999-
self._print_history_legent()
2022+
self._print_history_legend()
20002023
self._activate_search_term(self._history[self._selected_history_id])
20012024

20022025
elif char in (curses.ascii.SYN, ):
@@ -2014,7 +2037,7 @@ def keypress(self, char):
20142037
elif char in (curses.ascii.EM, ):
20152038
''' ^Y - Set default item '''
20162039
self._selected_history_id = 0
2017-
self._print_history_legent()
2040+
self._print_history_legend()
20182041
self._activate_search_term(self._history[self._selected_history_id])
20192042

20202043
else:
@@ -2073,7 +2096,7 @@ def keypress(self, char):
20732096
new_focus = self._focus + 2
20742097
# logger.error('DE focus = {}'.format(new_focus))
20752098
if new_focus == 15:
2076-
new_focus = 17
2099+
new_focus = 16
20772100
# logger.error('DE focus = {}'.format(new_focus))
20782101
self._apply_new_focus(new_focus)
20792102
else:

pyradio/radio.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4630,7 +4630,8 @@ def keypress(self, char):
46304630
elif char in (ord('t'), ) and \
46314631
self.ws.operation_mode not in (self.ws.EDIT_STATION_MODE,
46324632
self.ws.ADD_STATION_MODE, self.ws.THEME_MODE,
4633-
self.ws.RENAME_PLAYLIST_MODE, self.ws.CREATE_PLAYLIST_MODE) and \
4633+
self.ws.RENAME_PLAYLIST_MODE, self.ws.CREATE_PLAYLIST_MODE,
4634+
self.ws.BROWSER_SEARCH_MODE) and \
46344635
self.ws.operation_mode not in self.ws.PASSIVE_WINDOWS and \
46354636
not self.is_search_mode(self.ws.operation_mode) and \
46364637
self.ws.window_mode not in (self.ws.CONFIG_MODE, ):

0 commit comments

Comments
 (0)