Skip to content

Commit 0163112

Browse files
committed
version 0.9.2.16
1 parent cb4b6c4 commit 0163112

File tree

8 files changed

+72
-18
lines changed

8 files changed

+72
-18
lines changed

Changelog

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
2023-10-15 s-n-g
2+
* version 0.9.2.16
3+
* install.py: will terminate if python not in PATH
4+
* recorded files will have tags inserted in them if mkvmerge
5+
is detected. Chapters will also be added if the station
6+
provides ICY Titles
7+
* opening the config folder while recording will actually open the
8+
recording folder
9+
* buffering can now be disabled (in 0.9.2.15, once buffering was
10+
enabled, it could not be disabled until program termination)
11+
* fixing a couple of race confitions (threading lock files not being
12+
released) that would lead to a freeze
13+
* fixing players crash detection routines
14+
* fixing config players parsing
15+
* on Windows, downloaded recording files in the data directory
16+
will be deleted at startup, when recording is not active
17+
* adding recording man page
18+
* Updating docs
19+
120
2023-10-05 s-n-g
221
* version 0.9.2.15 (BUG FIX)
322
* fixing mplayer and vlc recording

README.html

+25
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ <h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><
171171
<li><a href="#packaging-pyradio">Packaging PyRadio</a>
172172
<ul>
173173
<li><a href="#distro-specific-files">Distro Specific Files</a></li>
174+
<li><a href="#mkvtoolnix-cli-installation">MKVToolNix cli installation</a></li>
174175
</ul></li>
175176
<li><a href="#todo">TODO</a></li>
176177
<li><a href="#acknowledgment">Acknowledgment</a></li>
@@ -207,11 +208,31 @@ <h2 id="requirements">Requirements <span style="padding-left: 10px;"><sup style=
207208
<li>netifaces (optional)</li>
208209
</ul></li>
209210
<li>MPV, MPlayer or VLC installed and in your path</li>
211+
<li>MKVToolNix (cli files) to insert tags and chapters to recordings (optional)</li>
210212
</ul>
211213
<!-- Changelog -->
212214
<h2 id="changelog">Changelog <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
213215
<pre style="height: 200px;">
214216

217+
2023-10-15 s-n-g
218+
* version 0.9.2.16
219+
* install.py: will terminate if python not in PATH
220+
* recorded files will have tags inserted in them if mkvmerge
221+
is detected. Chapters will also be added if the station
222+
provides ICY Titles
223+
* opening the config folder while recording will actually open the
224+
recording folder
225+
* buffering can now be disabled (in 0.9.2.15, once buffering was
226+
enabled, it could not be disabled until program termination)
227+
* fixing a couple of race confitions (threading lock files not being
228+
released) that would lead to a freeze
229+
* fixing players crash detection routines
230+
* fixing config players parsing
231+
* on Windows, downloaded recording files in the data directory
232+
will be deleted at startup, when recording is not active
233+
* adding recording man page
234+
* Updating docs
235+
215236
2023-10-05 s-n-g
216237
* version 0.9.2.15 (BUG FIX)
217238
* fixing mplayer and vlc recording
@@ -2136,6 +2157,10 @@ <h3 id="distro-specific-files">Distro Specific Files</h3>
21362157
<pre>sed -i &quot;s,&#39; -t &#39;,&#39; -d /path/to/desktop_file&#39; + &amp;,&quot; pyradio/main.py</pre>
21372158
<p><strong>2. Package Icon</strong></p>
21382159
<p>As of <strong>v. 0.9.1</strong>, <strong>PyRadio</strong> includes the icon in its distribution files, so no further action is necessary.</p>
2160+
<h3 id="mkvtoolnix-cli-installation">MKVToolNix cli installation</h3>
2161+
<p>Another thing to consider is whether you should mark <strong>MKVToolNix</strong> command line utilities as a dependency for <strong>PyRadio</strong>.</p>
2162+
<p>I would suggest to do so, in order to provide your users the best experience possible. If unsure, please refer to section <a href="recording.html#chapters">Chapters</a> in the relevant document.</p>
2163+
<p>In case you decide to do so, please make sure you mark as a dependency the <strong>command line utilities</strong>, not the GUI program, if that’s on a different package on your distro. For examle, Arch Linux provides both a <em>mkvtoolnix-cli</em> and a <em>mkvtoolnix-gui</em> package; the first one should be used. Same thing with Debian Linux; it provides a <em>mkvtoolnix</em> and a <em>mkvtoolnix-gui</em> package.</p>
21392164
<h2 id="todo">TODO <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
21402165
<ul class="task-list">
21412166
<li><input type="checkbox" />Any user request I find interesting :)</li>

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ If you face this situation, please refer to [this page](pip-error.md) to resolve
9292
* [Reporting bugs](#reporting-bugs)
9393
* [Packaging PyRadio](#packaging-pyradio)
9494
* [Distro Specific Files](#distro-specific-files)
95+
* [MKVToolNix cli installation](#mkvtoolnix-cli-installation)
9596
* [TODO](#todo)
9697
* [Acknowledgment](#acknowledgment)
9798
* [Special thanks](#special-thanks)
@@ -127,6 +128,7 @@ and much more...
127128
- python-dateutil
128129
- netifaces (optional)
129130
* MPV, MPlayer or VLC installed and in your path
131+
* MKVToolNix (cli files) to insert tags and chapters to recordings (optional)
130132

131133
<!-- Changelog -->
132134

@@ -1480,6 +1482,14 @@ sed -i "s,' -t ',' -d /path/to/desktop_file' + &," pyradio/main.py
14801482

14811483
As of **v. 0.9.1**, **PyRadio** includes the icon in its distribution files, so no further action is necessary.
14821484

1485+
### MKVToolNix cli installation
1486+
1487+
Another thing to consider is whether you should mark **MKVToolNix** command line utilities as a dependency for **PyRadio**.
1488+
1489+
I would suggest to do so, in order to provide your users the best experience possible. If unsure, please refer to section [Chapters](recording.md#chapters) in the relevant document.
1490+
1491+
In case you decide to do so, please make sure you mark as a dependency the **command line utilities**, not the GUI program, if that's on a different package on your distro. For examle, Arch Linux provides both a *mkvtoolnix-cli* and a *mkvtoolnix-gui* package; the first one should be used. Same thing with Debian Linux; it provides a *mkvtoolnix* and a *mkvtoolnix-gui* package.
1492+
14831493
## TODO
14841494

14851495
- [ ] Any user request I find interesting :)

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pyradio"
3-
version = "0.9.2.15"
3+
version = "0.9.2.16"
44
authors = [
55
{ name="Ben Dowling", email="[email protected]" },
66
{ name="Spiros Georgaras", email="[email protected]" },

pyradio/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
" pyradio -- Console radio player. "
33

4-
version_info = (0, 9, 2, 15)
4+
version_info = (0, 9, 2, 16)
55

66
# Set it to True if new stations have been
77
# added to the package's stations.csv

pyradio/install.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
''' This is PyRadio version this
1616
install.py was released for
1717
'''
18-
PyRadioInstallPyReleaseVersion = '0.9.2.15'
18+
PyRadioInstallPyReleaseVersion = '0.9.2.16'
1919

2020
import locale
2121
locale.setlocale(locale.LC_ALL, "")

pyradio/player.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,8 @@ def get_recording_filename(self, name, extension):
426426
version=self._cnf.current_pyradio_version,
427427
playlist=self._cnf.station_path,
428428
)
429-
self._chapters.look_for_mkvmerge()
429+
else:
430+
self._chapters.look_for_mkvmerge()
430431
f = datetime.now().strftime('%Y-%m-%d %H-%M-%S') + " " + name + extension
431432
if self._chapters.HAS_MKVTOOLNIX:
432433
return os.path.join(self._cnf.data_dir, f)
@@ -1899,7 +1900,11 @@ def play(self,
18991900
opts, self.monitor_opts = self._buildStartOpts(streamUrl, isPlayList)
19001901
self.stop_mpv_status_update_thread = False
19011902
if logger.isEnabledFor(logging.INFO):
1902-
logger.info('Executing command: {}'.format(' '.join(opts)))
1903+
try:
1904+
# python 2 exception with non-englsh chars
1905+
logger.info('Executing command: {}'.format(' '.join(opts)))
1906+
except:
1907+
pass
19031908
if platform.startswith('win') and self.PLAYER_NAME == 'vlc':
19041909
self.stop_win_vlc_status_update_thread = False
19051910
''' Launches vlc windowless '''
@@ -3667,7 +3672,7 @@ def write_chapters_to_file(self, input_file):
36673672
if logger.isEnabledFor(logging.INFO):
36683673
logger.info('starting mkvmerge!')
36693674
threading.Thread(
3670-
target=self._write_chapters_to_file_thread(input_file)
3675+
target=self.write_chapters_to_file_thread(input_file)
36713676
)
36723677
else:
36733678
if logger.isEnabledFor(logging.INFO):
@@ -3676,7 +3681,7 @@ def write_chapters_to_file(self, input_file):
36763681
if logger.isEnabledFor(logging.INFO):
36773682
logger.info('empty input file provided! Exiting!')
36783683

3679-
def _write_chapters_to_file_thread(self, input_file):
3684+
def write_chapters_to_file_thread(self, input_file):
36803685
if not input_file:
36813686
return False
36823687
if self.create_chapter_file(input_file):
@@ -3702,11 +3707,6 @@ def _write_chapters_to_file_thread(self, input_file):
37023707
outs, err = p.communicate()
37033708
# logger.error('outs = "{0}", err = "{1}"'.format(outs, err))
37043709
if p.returncode == 0:
3705-
for n in self._mkv_file, self._chapters_file, self._tag_file:
3706-
try:
3707-
os.remove(n)
3708-
except:
3709-
pass
37103710
if logger.isEnabledFor(logging.INFO):
37113711
logger.info('MKV merge successful!')
37123712
for n in self._chapters_file, self._tag_file, self._mkv_file:
@@ -3723,8 +3723,8 @@ def _write_chapters_to_file_thread(self, input_file):
37233723
def create_chapter_file(self, input_file):
37243724
if not input_file:
37253725
return False
3726-
logger.error('HAS_MKVTOOLNIX = {}'.format(self.HAS_MKVTOOLNIX))
3727-
logger.error('input_file = "{}"'.format(input_file))
3726+
# logger.error('HAS_MKVTOOLNIX = {}'.format(self.HAS_MKVTOOLNIX))
3727+
# logger.error('input_file = "{}"'.format(input_file))
37283728
if self.HAS_MKVTOOLNIX and \
37293729
os.path.exists(input_file):
37303730
# input_file.endswith('.mkv'):

pyradio/win.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
https://sourceforge.net/projects/mpv-player-windows/files/latest/download
3939
'''
4040
zurl = [
41-
'https://sourceforge.com/projects/mpv-player-windows/files/64bit/mpv-x86_64-20231001-git-e969072.7z/download',
41+
'https://sourceforge.com/projects/mpv-player-windows/files/64bit/mpv-x86_64-20231015-git-78d4374.7z/download',
4242
'https://sourceforge.net/projects/mplayerwin/files/MPlayer-MEncoder/r38151/mplayer-svn-38151-x86_64.7z/download'
4343
]
4444

@@ -741,9 +741,9 @@ def find_and_remove_recording_data(data_dir):
741741
).start()
742742

743743
def find_and_remove_recording_data_thread(data_dir):
744-
files = glob.glob('*.mkv', root_dir=data_dir)
745-
txt= glob.glob('*.txt', root_dir=data_dir)
746-
xml = glob.glob('*.xml', root_dir=data_dir)
744+
files = glob.glob(join(data_dir, '*.mkv'))
745+
txt = glob.glob(join(data_dir, '*.txt'))
746+
xml = glob.glob(join(data_dir, '*.xml'))
747747

748748
for i in range(len(txt)-1, -1, -1):
749749
if txt[i].startswith('search-'):

0 commit comments

Comments
 (0)