From 01631123ab6813ef972e480554041311680d93e8 Mon Sep 17 00:00:00 2001 From: Spiros Georgaras Date: Sun, 15 Oct 2023 19:54:24 +0300 Subject: [PATCH] version 0.9.2.16 --- Changelog | 19 +++++++++++++++++++ README.html | 25 +++++++++++++++++++++++++ README.md | 10 ++++++++++ pyproject.toml | 2 +- pyradio/__init__.py | 2 +- pyradio/install.py | 2 +- pyradio/player.py | 22 +++++++++++----------- pyradio/win.py | 8 ++++---- 8 files changed, 72 insertions(+), 18 deletions(-) diff --git a/Changelog b/Changelog index 27427385..2f1972b3 100644 --- a/Changelog +++ b/Changelog @@ -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 diff --git a/README.html b/README.html index f49cdcb5..bb4ce99d 100644 --- a/README.html +++ b/README.html @@ -171,6 +171,7 @@

Table of Contents <
  • Packaging PyRadio
  • TODO
  • Acknowledgment
  • @@ -207,11 +208,31 @@

    Requirements netifaces (optional)
  • MPV, MPlayer or VLC installed and in your path
  • +
  • MKVToolNix (cli files) to insert tags and chapters to recordings (optional)
  • Changelog Top

     
    +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
    @@ -2136,6 +2157,10 @@ 

    Distro Specific Files

    sed -i "s,' -t ',' -d /path/to/desktop_file' + &," pyradio/main.py

    2. Package Icon

    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 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 Top

    • Any user request I find interesting :)
    • diff --git a/README.md b/README.md index db8659a4..40b341f2 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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) @@ -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 :) diff --git a/pyproject.toml b/pyproject.toml index 21829f2c..c8b86f67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" }, diff --git a/pyradio/__init__.py b/pyradio/__init__.py index bad0f9c0..4c7d7f68 100644 --- a/pyradio/__init__.py +++ b/pyradio/__init__.py @@ -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 diff --git a/pyradio/install.py b/pyradio/install.py index 5d79f3e2..f32a0fe3 100644 --- a/pyradio/install.py +++ b/pyradio/install.py @@ -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, "") diff --git a/pyradio/player.py b/pyradio/player.py index 888f8933..07671e14 100644 --- a/pyradio/player.py +++ b/pyradio/player.py @@ -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) @@ -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 ''' @@ -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): @@ -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): @@ -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: @@ -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'): diff --git a/pyradio/win.py b/pyradio/win.py index aab04ecd..ea8f62d8 100644 --- a/pyradio/win.py +++ b/pyradio/win.py @@ -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' ] @@ -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-'):