Skip to content

Commit

Permalink
2.6.0 (#50)
Browse files Browse the repository at this point in the history
* Added: build and todo target

* pyradios new version

* Added: click count for UUID
changed welcome message slightly
fixed some debug message error when playing last station.

* Fix: empty alias entry issues

* Fix: handled API call errors

* Added: check ffplay runtime response
exit app on runtime error from ffplay
dead station play will not happen anymore

* doc: default volume is 80

* docs: ✨ a star history graph

added a project star history graph at the end of the README

* refactor: removed unnecessary TODO comments

* refactor: removed unnecessary comments

* docs: ✨ changelog added for 2.6.0

* feat: ⚡ app version 2.6.0

#43 #46 #49

* fix: 🐛 errors while trying to add existing station in fav list

fixed error while trying to add a station which is already in list. It will now show a message.

* chore: 🔧 .editorconfig added

* build: ✨ add code formatting and inting

* build: 🎨 add black formatter module

* style(isort): 🎨 sort imports with isorted tool

sorted the import statements using isort tool

* style(format): 🎨 minor code format

* build: 🔥 remove sentry-sdk

* style: 🔥 remove unnecessary commented lines

* style: 🎨 minor style fixes

* build(vscode): 💄 add fira code and minimap styles for future reference

* style: 💄 remove color from panel title radioactive

* perf(ffplay): ⚡ check ffplay errors after every 2 seconds

instead of checking errors in an infinite loop, check will happend after every 2 seconds

* build(editorconfig): add py related configs

* docs: add new feature entries

* fix: 🐛 fix error when no internet available

fix unhandled errors while there is a connection issue and pyradios cannot connect to the API

* docs(arch): add rough flowchart

A rough code flowchart is added with drawio

* build: 🔥 fix bug that caused format checks under build dir

build dir is excluded from flake8 check

* refactor(bare except): 🎨 handle bare exception format errors

update bare exceptions and handled with debug information
  • Loading branch information
deep5050 authored Sep 24, 2023
1 parent 5d9cf0c commit b3ad5b8
Show file tree
Hide file tree
Showing 18 changed files with 782 additions and 181 deletions.
28 changes: 28 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 80

[*.c]
indent_size = 4
c_basic_style = linux
c_brace_style = stroustrup

[*.py]
indent_size = 4
indent_style = space
max_line_length = 79

[*.sh]
indent_size = 2
shell = bash

[Makefile]
indent_style = tab
indent_size = 4
13 changes: 11 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,14 @@
"language": "markdown",
"scheme": "file"
}
]
}
],
"files.autoSave": "afterDelay",
"editor.wordWrap": "wordWrapColumn",
"workbench.colorTheme": "Quiet Light",
"editor.minimap.autohide": true,
"editor.minimap.renderCharacters": false,
"editor.experimentalWhitespaceRendering": "font",
"editor.fontFamily": "'Fira Code', Consolas, 'Courier New', monospace",
"editor.codeLensFontFamily": "'Fira Code'",
"editor.fontLigatures": true
}
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 2.6.0

1. Detect errors while trying to play a dead station or encountering other connection errors.
2. Playing a station will increase the click (vote) counter for that station on the server.
3. Fixed bugs that occurred when there was a blank entry in the favorite station file.
4. Fixed bugs that caused empty last stations.
5. Handled errors related to connection issues when attempting to search for a station.
6. Improved `ffplay` process handling by introducing a thread to monitor runtime errors from the process.
7. `pyradios` module updated to latest version.


## 2.5.2

1. Added `--kill` option to stop background radios if any.
Expand Down
42 changes: 31 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
SHELL := /bin/bash
PYTHON = python3
TEST_PATH = ./tests/
FLAKE8_EXCLUDE = venv,.venv,.eggs,.tox,.git,__pycache__,*.pyc
FLAKE8_EXCLUDE = venv,.venv,.eggs,.tox,.git,__pycache__,*.pyc,build
SRC_DIR = "radioactive"
TEST_DIR = "test"

all: clean install-dev test
.PHONY: all clean isort check dist deploy test-deploy help build install install-dev test
all: clean format check build install

check:
@echo "Chceking linting errors......."
${PYTHON} -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude ${FLAKE8_EXCLUDE}
${PYTHON} -m flake8 . --count --exit-zero --max-complexity=10 --max-line-length=79 --statistics --exclude ${FLAKE8_EXCLUDE}

clean:
@echo "Cleaning build artifacts......"
@find . -name '*.pyc' -exec rm --force {} +
@find . -name '*.pyo' -exec rm --force {} +
@find . -name '*~' -exec rm --force {} +
Expand All @@ -24,37 +27,54 @@ clean:
dist: clean
${PYTHON} setup.py sdist bdist_wheel

deploy:
deploy: dist
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*

test-deploy: dist
@echo "-------------------- sending to testpypi server ------------------------"
@echo "Sending to testpypi server......."
@twine upload -r testpypi dist/*

help:
@echo "---------------------------- help --------------------------------------"
@echo "help............."
@echo " clean"
@echo " Remove python artifacts and build artifacts."
@echo " isort"
@echo " Sort import statements."
@echo " build"
@echo " Build the target app"
@echo " install"
@echo " Install the target app"
@echo " check"
@echo " Check style with flake8."
@echo " test"
@echo " Run pytest"
@echo " todo"
@echo " Finding lines with 'TODO'"

isort:
@echo "Sorting imports..."
@echo "Sorting imports....."
isort $(SRC_DIR) $(TEST_DIR)

build:
python3 setup.py build
build: format
@echo "Building........."
${PYTHON} setup.py build

install:
install: build
@echo "Installing........."
pip install -e .

install-dev: install
pip install --upgrade pip
pip install -e .[dev]

test:
test:
${PYTHON} -m pytest ${TEST_PATH}

todo:
@echo "Finding lines with 'TODO:' in current directory..."
@grep -rn 'TODO:' ./radioactive

format:
@echo "Formatting files using black..........."
${PYTHON} -m black setup.py
${PYTHON} -m black radioactive/*
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<div align=center>
<p align=center><img src=https://user-images.githubusercontent.com/27947066/267328833-3e81a98e-2acb-4291-89cb-f3f9bed6c299.png width=250px></p>
<h1 align=center> RADIO-ACTIVE </h1>

<p align=center> Play any radios around the globe right from your terminal </p>

<a href="https://www.producthunt.com/posts/radio-active?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-radio-active" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=305380&theme=dark" alt="radio-active - Play more than 30K radio stations from your terminal | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>

<p align=center ><img align=center src=https://static.pepy.tech/personalized-badge/radio-active?period=total&units=international_system&left_color=black&right_color=green&left_text=TotalInstalls></p>
<p align=center ><img align=center src=https://static.pepy.tech/personalized-badge/radio-active?period=total&units=international_system&left_color=black&right_color=green&left_text=TotalInstalls></p>
<p>
<img width="500px" alt="UPI" src="https://user-images.githubusercontent.com/27947066/235618869-8c9d9bce-096d-469e-8f61-c29cc01eacc3.png">
</p>
Expand All @@ -27,16 +28,18 @@

### Features

- [x] Supports more than 30K stations !!
- [x] Supports more than 40K stations !! :radio:
- [x] Saves last station information
- [x] Favorite stations (Aliasing)
- [x] Supports user-added stations
- [x] Favorite stations (Aliasing) :heart:
- [x] Selection menu for favorite stations
- [x] Supports user-added stations :wrench:
- [x] Looks minimal and user-friendly
- [x] Runs on Raspberry-Pi
- [x] Finds nearby stations
- [x] Discovers stations by genre
- [x] Discovers stations by language
- [ ] I'm feeling lucky ! Play Random stations
- [ ] Record audio from live radio on demand :zap:


> See my progress [here](https://github.com/deep5050/radio-active/projects/1)
Expand Down Expand Up @@ -106,7 +109,7 @@ Run with `radioactive --station [STATION_NAME]` or as simply `radio -U [UUID] `
| `--discover-by-tag` | Optional | Discover stations by tags/genre | False |
| `--discover-by-language` | optional | Discover stations by | False |
| `--limit` | Optional | Limit the # of results in the Discover table | 100 |
| `--volume` | Optional | Change the volume passed into ffplay | 50 |
| `--volume` | Optional | Change the volume passed into ffplay | 80 |
| `--kill` | Optional | Kill background radios. | False |

<hr>
Expand All @@ -120,11 +123,11 @@ Run with `radioactive --station [STATION_NAME]` or as simply `radio -U [UUID] `
> results for the same name) use the station's uuid to play . --uuid gets the
> greater priority than --station. Example: 96444e20-0601-11e8-ae97-52543be04c81
> `--log-level`, `-L` : don't need to specify unless you are developing it. `info` , `warning` , `error` , `debug`
> `--log-level`, `-L` : don't need to specify unless you are developing it. `info` , `warning` , `error` , `debug`
> `-F` : Add current station to your favorite list. Example: `-F my_fav_1`
> `-A`: Add any stations to your list. You can add stations that are not currently available on our API. When adding a new station enter a name and direct URL to the audio stream.
> `-A`: Add any stations to your list. You can add stations that are not currently available on our API. When adding a new station enter a name and direct URL to the audio stream.

### Changes
Expand All @@ -144,7 +147,7 @@ If you ever face a situation where radio-active quits but the audio (ffplay) run

### Support

<p>
<p>
<a href=https://deep5050.github.io/payme>Visit my contribution page for more payment options.
</p>
<p align=center><a href="https://www.buymeacoffee.com/deep5050" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 40px !important;width: 117px !important;" ></a></p>
Expand Down Expand Up @@ -183,3 +186,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

<div align=center>
<p>
<img src=https://stars.medv.io/deep5050/radio-active.svg align=center>
</p>
</div>
Loading

0 comments on commit b3ad5b8

Please sign in to comment.