Pyradio can't save default station

For as long as i use Pyradio I can’t save a new default station for startup.

It alway’s choosen the 5th station.
So i put my Fav on the 5th place.

Starting pyradio with . . .
terminator -T ${NAME} --icon="${PYRADIO_ICON_FILE}" --geometry "$POS" -e 'pyradio -p -lt'
TUI : “C” followed by “S”

Def station: XX : Doesn’t matter what i fill in. Always the 5th.

I cannot see what I am overlooking.

Mabox_20230712-11-02-32

CONFIG (.config/pyradio)
# PyRadio Configuration File

# Player selection
# This is the equivalent to the -u , --use-player command line parameter
# Specify the player to use with PyRadio, or the player detection order
# Example:
#   player = vlc
# or
#   player = vlc,mpv, mplayer
# Default value: mpv,mplayer,vlc
player = mpv,mplayer,vlc

# Open last playlist
# If this option is enabled, the last opened playlist will be opened
# the next time PyRadio is opened. This option will take precedence
# over the "Def. playlist" option.
# Default value: False
open_last_playlist = True

# Default playlist
# This is the playlist to open if none is specified
# You can specify full path to CSV file, or if the playlist is in the
# config directory, playlist name (filename without extension) or
# playlist number (as reported by -ls command line option)
# Default value: stations
default_playlist = stations

# Default station
# This is the equivalent to the -p , --play command line parameter
# The station number within the default playlist to play
# Value is 1..number of stations, "-1" or "False" means no auto play
# "0" or "Random" means play a random station
# Default value: False
default_station = 6

# Default encoding
# This is the encoding used by default when reading data provided by
# a station (such as song title, etc.) If reading said data ends up
# in an error, 'utf-8' will be used instead.
#
# A valid encoding list can be found at:
#   https://docs.python.org/2.7/library/codecs.html#standard-encodings
# replacing 2.7 with specific version:
#   3.0 up to current python version.
#
# Default value: utf-8
default_encoding = utf-8

# Enable mouse
# If this options is enabled, the mouse can be used to scroll the
# playlist, start, stop and mute the player, adjust its volume etc.
# Mouse integration is highly terminal dependent, that's why it
# is disabled by default.
#
# Default value: False
enable_mouse = True

# Desktop notifications
# If this option is enabled, a Desktop Notification will be
# displayed using the notification daemon / service.
# If enabled but no notification is displayed, please refer to
# https://github.com/coderholic/pyradio/desktop-notification.md
# Valid values are:
#    -1: disabled
#     0: enabled (no repetition)
#     x: enabled and repeat every x seconds
#
# Default value: -1
enable_notifications = -1

# Station icon
# Radio Browser will provide an icon for some of its stations.
# This icon can be downloaded and used in Desktop Notifications,
# if this option is True.
#
# Default value: True
use_station_icon = True

# Connection timeout
# PyRadio will wait for this number of seconds to get a station/server
# message indicating that playback has actually started.
# If this does not happen (within this number of seconds after the
# connection is initiated), PyRadio will consider the station
# unreachable, and display the "Failed to connect to: [station]"
# message.
#
# Valid values: 5 - 60, 0 disables check
# Default value: 10
connection_timeout = 10

# Force http connections
# Most radio stations use plain old http protocol to broadcast, but
# some of them use https. If this is enabled,  all connections will
# use http; results depend on the combination of station/player.
#
# Valid values: True, true, False, false
# Default value: False
force_http = False

# Default theme
# Hardcooded themes:
#   dark (default) (8 colors)
#   light (8 colors)
#   dark_16_colors (16 colors dark theme alternative)
#   light_16_colors (16 colors light theme alternative)
#   black_on_white (bow) (256 colors)
#   white_on_black (wob) (256 colors)
# If theme is watched for changes, prepend its name
# with an asterisk (i.e. '*my_theme')
# This is applicable for user themes only!
# Default value = 'dark'
theme = mbcolors

# Transparency setting
# If False, theme colors will be used.
# If True and a compositor is running, the stations' window
# background will be transparent. If True and a compositor is
# not running, the terminal's background color will be used.
# Valid values: True, true, False, false
# Default value: False
use_transparency = False

# Calculated color factor
# This is to produce Secondary Windows background color
# A value of 0 dissables it, otherwise it is the factor
# to change (lighten or darken) the base color.
# For more info, please refer to
# https://github.com/coderholic/pyradio#secondary-windows-background
# Valid values: 0-0.2
# Default value: 0
calculated_color_factor = 0.02

# Playlist management
#
# Specify whether you will be asked to confirm
# every station deletion action
# Valid values: True, true, False, false
# Default value: True
confirm_station_deletion = True

# Specify whether you will be asked to confirm
# playlist reloading, when the playlist has not
# been modified within PyRadio
# Valid values: True, true, False, false
# Default value: True
confirm_playlist_reload = True

# Specify whether you will be asked to save a
# modified playlist whenever it needs saving
# Valid values: True, true, False, false
# Default value: False
auto_save_playlist = True

# When PyRadio determines that a restricted
# terminal is used, it will display a message
# every time it is lounched. To disable this
# message, change the value to False.
# Default value: True
show_no_themes_message = False

# Remote Control server
# A simple http server that can accept remote
# connections and pass commands to PyRadio
#
# Valid values:
#   remote_control_server_ip: localhost, LAN, lan
#   remote_control_server_port: 1025-65535
#
# Default value: localhost:9998
#                no auto start
remote_control_server_ip = localhost
remote_control_server_port = 9998
remote_control_server_auto_start = True

Changing default station directly into the config, doesn’t work either.

:bird:

Hi @muzqs

Try setting

open_last_playlist = False

then, you shouldn’t even have to use -p within the -e parameter

1 Like

Hi muzqs

Always exit by pressing the q then it will remember the station you set

open_last_playlist = False

I have it set to true

I apologize for any mistakes as I am writing with a translator :frowning_face:

1 Like

Actually, there are two different functions here

  1. open_last_playlist = True (“Open last playlist” in the config window).
    This one means PyRadio will play the station that was playing when it last exited., i.e. play station “My station”, press “q” to exit, then start PyRadio again, the same station (“My station”) will start playing again.
    If you start playing another station “Station2” and press “q”, when you start the program again, “Station2” will start playing.
    It’s kind of a dynamic thing.
  2. Using the “Def. playlist” ( = playlist name) and “Def. station” ( = stration number) combination.
    In this case, PyRadio will always open the given playlist, and play station number set in Def. station.

If both functions are active in the config, Open last playlist will be used.

3 Likes

Thanks @sng & @Gr3goR,

Actually I did not use -p, but added it for 1 or other reason before posting. Usually I just used the -lt.
I removed the -p again.


Indeed, setting open play last to False/false is working.
It’s now possible to set Fav station.


Is it TRUE that now that when open play last is set to False that exit Q does not work.
Is it 1 or the other.

If TRUE : Thought spinning.

I would suspect that now that I can fix a fav station with open play last = False with
exit Q I could temporarily make another station favorite until the program exits with like Alt-F4.

I think it could be nice to have some kind of intermediate possibility.

The situation.

  • You determined your favorite station at each new startup. (nice)
    But …
  • Now you listen to another station which you want to temporarily fix.
    Because you think you like it temporarily, just for next time this day, above your REAL Fav station.
    Closing this with Q could still do ??

Does this make sense . . . :robot:

:bird:

2 Likes

Sure, just have “Open last playlist” set to true temporarily, then when you want to get back to your previous fav. station, just set it to false.

Just three / four keys to press, if I get a meaningful key combination for it, I may have if set to it, how’s that?

2 Likes

I just set it up to \l
So, you’ll get it at the next release :wink:

2 Likes

Thanks for all the hard work @sng on Pyradio.

AI - pix generated : [python with headphones on]

I am testing different Ai services. It’s from a free account: with watermark.





:bird:

4 Likes

Works nicely :slight_smile: . . . .

1 Like

wow, really art. Very nice. :+1:

2 Likes