Skip to content

Commit

Permalink
version 0.9.2.16
Browse files Browse the repository at this point in the history
  • Loading branch information
s-n-g committed Oct 15, 2023
1 parent cb4b6c4 commit 0163112
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 18 deletions.
19 changes: 19 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
2023-10-15 s-n-g
* version 0.9.2.16
* install.py: will terminate if python not in PATH
* recorded files will have tags inserted in them if mkvmerge
is detected. Chapters will also be added if 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
* fixing players crash detection routines
* fixing config players parsing
* on Windows, downloaded recording files in the data directory
will be deleted at startup, when recording is not active
* adding recording man page
* Updating docs

2023-10-05 s-n-g
* version 0.9.2.15 (BUG FIX)
* fixing mplayer and vlc recording
Expand Down
25 changes: 25 additions & 0 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ <h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><
<li><a href="#packaging-pyradio">Packaging PyRadio</a>
<ul>
<li><a href="#distro-specific-files">Distro Specific Files</a></li>
<li><a href="#mkvtoolnix-cli-installation">MKVToolNix cli installation</a></li>
</ul></li>
<li><a href="#todo">TODO</a></li>
<li><a href="#acknowledgment">Acknowledgment</a></li>
Expand Down Expand Up @@ -207,11 +208,31 @@ <h2 id="requirements">Requirements <span style="padding-left: 10px;"><sup style=
<li>netifaces (optional)</li>
</ul></li>
<li>MPV, MPlayer or VLC installed and in your path</li>
<li>MKVToolNix (cli files) to insert tags and chapters to recordings (optional)</li>
</ul>
<!-- Changelog -->
<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>
<pre style="height: 200px;">

2023-10-15 s-n-g
* version 0.9.2.16
* install.py: will terminate if python not in PATH
* recorded files will have tags inserted in them if mkvmerge
is detected. Chapters will also be added if 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
* fixing players crash detection routines
* fixing config players parsing
* on Windows, downloaded recording files in the data directory
will be deleted at startup, when recording is not active
* adding recording man page
* Updating docs

2023-10-05 s-n-g
* version 0.9.2.15 (BUG FIX)
* fixing mplayer and vlc recording
Expand Down Expand Up @@ -2136,6 +2157,10 @@ <h3 id="distro-specific-files">Distro Specific Files</h3>
<pre>sed -i &quot;s,&#39; -t &#39;,&#39; -d /path/to/desktop_file&#39; + &amp;,&quot; pyradio/main.py</pre>
<p><strong>2. Package Icon</strong></p>
<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>
<h3 id="mkvtoolnix-cli-installation">MKVToolNix cli installation</h3>
<p>Another thing to consider is whether you should mark <strong>MKVToolNix</strong> command line utilities as a dependency for <strong>PyRadio</strong>.</p>
<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>
<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>
<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>
<ul class="task-list">
<li><input type="checkbox" />Any user request I find interesting :)</li>
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ If you face this situation, please refer to [this page](pip-error.md) to resolve
* [Reporting bugs](#reporting-bugs)
* [Packaging PyRadio](#packaging-pyradio)
* [Distro Specific Files](#distro-specific-files)
* [MKVToolNix cli installation](#mkvtoolnix-cli-installation)
* [TODO](#todo)
* [Acknowledgment](#acknowledgment)
* [Special thanks](#special-thanks)
Expand Down Expand Up @@ -127,6 +128,7 @@ and much more...
- python-dateutil
- netifaces (optional)
* MPV, MPlayer or VLC installed and in your path
* MKVToolNix (cli files) to insert tags and chapters to recordings (optional)

<!-- Changelog -->

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

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

### MKVToolNix cli installation

Another thing to consider is whether you should mark **MKVToolNix** command line utilities as a dependency for **PyRadio**.

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.

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.

## TODO

- [ ] Any user request I find interesting :)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pyradio"
version = "0.9.2.15"
version = "0.9.2.16"
authors = [
{ name="Ben Dowling", email="ben.m.dowling@gmail.com" },
{ name="Spiros Georgaras", email="sng@hellug.gr" },
Expand Down
2 changes: 1 addition & 1 deletion pyradio/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
" pyradio -- Console radio player. "

version_info = (0, 9, 2, 15)
version_info = (0, 9, 2, 16)

# Set it to True if new stations have been
# added to the package's stations.csv
Expand Down
2 changes: 1 addition & 1 deletion pyradio/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
''' This is PyRadio version this
install.py was released for
'''
PyRadioInstallPyReleaseVersion = '0.9.2.15'
PyRadioInstallPyReleaseVersion = '0.9.2.16'

import locale
locale.setlocale(locale.LC_ALL, "")
Expand Down
22 changes: 11 additions & 11 deletions pyradio/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@ def get_recording_filename(self, name, extension):
version=self._cnf.current_pyradio_version,
playlist=self._cnf.station_path,
)
self._chapters.look_for_mkvmerge()
else:
self._chapters.look_for_mkvmerge()
f = datetime.now().strftime('%Y-%m-%d %H-%M-%S') + " " + name + extension
if self._chapters.HAS_MKVTOOLNIX:
return os.path.join(self._cnf.data_dir, f)
Expand Down Expand Up @@ -1899,7 +1900,11 @@ def play(self,
opts, self.monitor_opts = self._buildStartOpts(streamUrl, isPlayList)
self.stop_mpv_status_update_thread = False
if logger.isEnabledFor(logging.INFO):
logger.info('Executing command: {}'.format(' '.join(opts)))
try:
# python 2 exception with non-englsh chars
logger.info('Executing command: {}'.format(' '.join(opts)))
except:
pass
if platform.startswith('win') and self.PLAYER_NAME == 'vlc':
self.stop_win_vlc_status_update_thread = False
''' Launches vlc windowless '''
Expand Down Expand Up @@ -3667,7 +3672,7 @@ def write_chapters_to_file(self, input_file):
if logger.isEnabledFor(logging.INFO):
logger.info('starting mkvmerge!')
threading.Thread(
target=self._write_chapters_to_file_thread(input_file)
target=self.write_chapters_to_file_thread(input_file)
)
else:
if logger.isEnabledFor(logging.INFO):
Expand All @@ -3676,7 +3681,7 @@ def write_chapters_to_file(self, input_file):
if logger.isEnabledFor(logging.INFO):
logger.info('empty input file provided! Exiting!')

def _write_chapters_to_file_thread(self, input_file):
def write_chapters_to_file_thread(self, input_file):
if not input_file:
return False
if self.create_chapter_file(input_file):
Expand All @@ -3702,11 +3707,6 @@ def _write_chapters_to_file_thread(self, input_file):
outs, err = p.communicate()
# logger.error('outs = "{0}", err = "{1}"'.format(outs, err))
if p.returncode == 0:
for n in self._mkv_file, self._chapters_file, self._tag_file:
try:
os.remove(n)
except:
pass
if logger.isEnabledFor(logging.INFO):
logger.info('MKV merge successful!')
for n in self._chapters_file, self._tag_file, self._mkv_file:
Expand All @@ -3723,8 +3723,8 @@ def _write_chapters_to_file_thread(self, input_file):
def create_chapter_file(self, input_file):
if not input_file:
return False
logger.error('HAS_MKVTOOLNIX = {}'.format(self.HAS_MKVTOOLNIX))
logger.error('input_file = "{}"'.format(input_file))
# logger.error('HAS_MKVTOOLNIX = {}'.format(self.HAS_MKVTOOLNIX))
# logger.error('input_file = "{}"'.format(input_file))
if self.HAS_MKVTOOLNIX and \
os.path.exists(input_file):
# input_file.endswith('.mkv'):
Expand Down
8 changes: 4 additions & 4 deletions pyradio/win.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
https://sourceforge.net/projects/mpv-player-windows/files/latest/download
'''
zurl = [
'https://sourceforge.com/projects/mpv-player-windows/files/64bit/mpv-x86_64-20231001-git-e969072.7z/download',
'https://sourceforge.com/projects/mpv-player-windows/files/64bit/mpv-x86_64-20231015-git-78d4374.7z/download',
'https://sourceforge.net/projects/mplayerwin/files/MPlayer-MEncoder/r38151/mplayer-svn-38151-x86_64.7z/download'
]

Expand Down Expand Up @@ -741,9 +741,9 @@ def find_and_remove_recording_data(data_dir):
).start()

def find_and_remove_recording_data_thread(data_dir):
files = glob.glob('*.mkv', root_dir=data_dir)
txt= glob.glob('*.txt', root_dir=data_dir)
xml = glob.glob('*.xml', root_dir=data_dir)
files = glob.glob(join(data_dir, '*.mkv'))
txt = glob.glob(join(data_dir, '*.txt'))
xml = glob.glob(join(data_dir, '*.xml'))

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

0 comments on commit 0163112

Please sign in to comment.