Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
- [x] Supports more than 40K stations !! :radio:
- [x] Record audio from live radio on demand :zap:
- [x] Get song information on run-time 🎶
- [x] Runtime station search and switching :mag:
- [x] Saves last station information
- [x] Favorite stations :heart:
- [x] Selection menu for favorite stations
Expand Down Expand Up @@ -190,10 +191,14 @@ Input a command during the radio playback to perform an action. Available comman
```
Enter a command to perform an action: ?

p/P: Play/Pause current station
s/S/search: Search and switch to new station
c/C/cycle: Choose different station from last search
t/T/track: Current song name (track info)
r/R/record: Record a station
f/F/fav: Add station to favorite list
rf/RF/recordfile: Specify a filename for the recording.
rf/RF/recordfile: Specify a filename for the recording
w/W/list: Show favorite stations
h/H/help/?: Show this help message
q/Q/quit: Quit radioactive
```
Expand Down
12 changes: 12 additions & 0 deletions radioactive/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
handle_update_screen,
handle_user_choice_from_search_result,
handle_welcome_screen,
store_search_results_for_cycling,
)

# globally needed as signal handler needs it
Expand Down Expand Up @@ -97,13 +98,16 @@ def final_step(options, last_station, alias, handler):
handle_listen_keypress(
alias,
player,
handler,
last_station,
target_url=options["target_url"],
station_name=options["curr_station_name"],
station_url=options["target_url"],
record_file_path=options["record_file_path"],
record_file=options["record_file"],
record_file_format=options["record_file_format"],
loglevel=options["loglevel"],
volume=options["volume"],
)


Expand Down Expand Up @@ -164,6 +168,8 @@ def main():
options["sort_by"],
options["filter_with"],
)
# Store results for cycling
store_search_results_for_cycling(response, "country discovery")
if response is not None:
(
options["curr_station_name"],
Expand All @@ -181,6 +187,8 @@ def main():
options["sort_by"],
options["filter_with"],
)
# Store results for cycling
store_search_results_for_cycling(response, "state discovery")
if response is not None:
(
options["curr_station_name"],
Expand All @@ -198,6 +206,8 @@ def main():
options["sort_by"],
options["filter_with"],
)
# Store results for cycling
store_search_results_for_cycling(response, "language discovery")
if response is not None:
(
options["curr_station_name"],
Expand All @@ -215,6 +225,8 @@ def main():
options["sort_by"],
options["filter_with"],
)
# Store results for cycling
store_search_results_for_cycling(response, "tag discovery")
if response is not None:
(
options["curr_station_name"],
Expand Down
17 changes: 12 additions & 5 deletions radioactive/ffplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,18 @@ def _start_error_thread(self):

def _check_error_output(self):
while self.is_running:
stderr_result = self.process.stderr.readline()
if stderr_result:
self._handle_error(stderr_result)
self.is_running = False
self.stop()
# Check if process is still valid before accessing stderr
if self.process is None:
break
try:
stderr_result = self.process.stderr.readline()
if stderr_result:
self._handle_error(stderr_result)
self.is_running = False
self.stop()
except (AttributeError, ValueError):
# Process was stopped or stderr is no longer available
break
sleep(2)

def _handle_error(self, stderr_result):
Expand Down
Loading
Loading