Skip to content

Commit 92d54bc

Browse files
committed
- recorded files will have chapters inserted in them if a) mkvmerge is
detected and b) the station provides ICY Titles - opening the config folder while recording will actually open the recording folder - buffering can now be disabled (in 0.9.2.15, once buffering was enabled, it could not be disabled until program termination) - fixing a couple of race confitions (threading lock files not being released) that would lead to a freeze
1 parent a931691 commit 92d54bc

File tree

4 files changed

+281
-18
lines changed

4 files changed

+281
-18
lines changed

pyradio/config.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1740,15 +1740,16 @@ def setup_mouse(self):
17401740
| curses.REPORT_MOUSE_POSITION)
17411741
#curses.mouseinterval(0)
17421742

1743-
def open_config_dir(self):
1743+
def open_config_dir(self, recording=0):
1744+
a_dir = self.stations_dir if recording == 0 else self.recording_dir
17441745
if system().lower() == 'windows':
1745-
startfile(self.stations_dir)
1746+
startfile(a_dir)
17461747
elif system().lower() == 'darwin':
1747-
Popen(['open', self.stations_dir])
1748+
Popen(['open', a_dir])
17481749
else:
17491750
try:
17501751
Popen(
1751-
['xdg-open', self.stations_dir],
1752+
['xdg-open', a_dir],
17521753
stderr=DEVNULL,
17531754
stdout=DEVNULL
17541755
)

pyradio/log.py

+15
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
if platform.lower().startswith('win'):
3535
import ctypes
3636

37+
3738
class Log(object):
3839
''' Log class that outputs text to a curses screen '''
3940

@@ -69,6 +70,8 @@ class Log(object):
6970
_station_that_is_playing_now = ''
7071
_last = ['', '']
7172

73+
_add_chapter_function = None
74+
7275
can_display_help_msg = None
7376

7477
def __init__(self, config, get_web_song_title):
@@ -95,6 +98,15 @@ def station_that_is_playing_now(self):
9598
with self._song_title_lock:
9699
return self._station_that_is_playing_now
97100

101+
@property
102+
def add_chapters_function(self):
103+
return self._add_chapter_function
104+
105+
@add_chapters_function.setter
106+
def add_chapters_function(self, val):
107+
with self.lock:
108+
self._add_chapter_function = val
109+
98110
def setScreen(self, cursesScreen):
99111
self.cursesScreen = cursesScreen
100112
self.width = int(cursesScreen.getmaxyx()[1] - 1)
@@ -210,6 +222,9 @@ def write(self,
210222
elif msg.startswith('Buffering: '):
211223
self._station_that_is_playing_now = msg[11:]
212224

225+
if self._add_chapter_function is not None and msg:
226+
if msg.startswith('Title: '):
227+
self._add_chapter_function(msg.replace('Title: ', ''))
213228
self.set_win_title(self.msg)
214229
self._write_title_to_log(msg if msg else 'No')
215230
self._show_notification(msg)

0 commit comments

Comments
 (0)