Skip to content

Commit

Permalink
2.7.0 (#56)
Browse files Browse the repository at this point in the history
* feat: ✨ add recording support for a station

record an audio stream with --record on

fixes #48

* build: test mp3 files ignored

* refactor: 🎨 formatted main into several functions

moved codes under main() to utilities as several functions

* feat: 🎨 add --record and --filename and remove --random

two arguments --record and --filename are added to support recording of a live audio stream

* feat: add limit on search by name

add limit on results on stations found by name

* docs: 🔥 remove install guide

* refactor: 🎨 help message logic updated

* build(vscode): manual save

* feat: ✨ add a command listener to the app

users can give command on runtime and execute various options like record, fav station, list show etc

* feat: 👽 rename --station to --search

use --search instead of --station to search for stations with name on the API

--search instead of --station

* refactor: 🎨 minor refactoring

* perf(cache): ⚡ add chaching mechanism for faster API queries

added request_cache module to initiate a cached RadioBrowser object

* build: ✨ add request_cache module for API cache

* feat: ✨ add command listener handler

a function that listens for user inputs in a loop and performs actions accrodingly

* refactor: 🎨 different functions for each options

* feat: 🔧 modified some options name

modified some option names like --station to --search

* feat: 🔧 updated help table for modified options

* build: sqlite cache added to ignore

* docs: ✨ update option list and screenshot

* style: 💄 trim long entries on result page with ...

short name column to 30 char and tag to 40 char for better table UI

* feat: ✨ user input to play a station from search result directly

promt user to type an ID from the result page to play directly

* feat: ✨ user input handler for search response

* build: 🔥 clean mp3 files if any

* feat: ✨ add --play for direct play feature

directly play stations from fav list or stream url

* style: add minor debug log

* style: 🎨 minor format

* feat: ✨ add new options

* fix: 🐛 fix minor bug

* feat: ✨ add runtime commands and recording features

* docs: ✨ add docs for new features

* docs: ✨ v2.7.0

* feat: ✨ 2.7.0

* feat: ✨ add --last option to play last station

play the last played station directly with --last

* docs: ✨ add doc for --last

* docs: ✨ v2.7.0

* fix: 🚑 fix bug quit on pressing anything than y

* feat: 💄 remove UUID from result page for compact view

* feat: updated several options name

* v2.7.0
  • Loading branch information
deep5050 committed Sep 28, 2023
1 parent b3ad5b8 commit 6090a16
Show file tree
Hide file tree
Showing 15 changed files with 781 additions and 404 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,8 @@ deploy.sh

pylint.txt
.gitpod.yml
tests/
tests/

*.mp3
cache.sqlite
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"scheme": "file"
}
],
"files.autoSave": "afterDelay",
"files.autoSave": "off",
"editor.wordWrap": "wordWrapColumn",
"workbench.colorTheme": "Quiet Light",
"editor.minimap.autohide": true,
Expand Down
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
## 2.7.0

1. Recording support added 🎉 . save recording as mp3 or wav 🎶 `--record`
2. Play a station from your favorite list or stream a URL directly without any user selection menu. Useful when running from other scripts. `--play`
3. Play the last played station directly. `--last`
4. Runtime command feature added. Perform actions on demand ⚡
5. A caching mechanism was added for fewer API calls. Faster radio playbacks!
6. Code refactored. It is easier for contributors to implement new features.
7. BREAKING CHANGES: `--station` -> `--search`, `--discover-by-country` -> `--country`, `--discover-by-tag` -> `--tag`, `--discover-by-state` -> `--state`, `--discover-by-language` -> `--lamguage`, `--add-station` -> `--add`, `--add-to-favorite` -> `--favorite`, `--show-favorite-list` -> `--list`


## 2.6.0

1. Detect errors while trying to play a dead station or encountering other connection errors.
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.
Expand Down Expand Up @@ -44,7 +55,7 @@ Fixed setup-related issues (development purpose)

## 2.3.0

1. Discover stations by country
1. Discover stations by country
2. Discover stations by state
3. Discover stations by genre/tags
4. Discover stations by language
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ clean:
rm -rf *.egg-info
rm -f *.sqlite
rm -rf .cache
rm -rf *.mp3

dist: clean
${PYTHON} setup.py sdist bdist_wheel
Expand Down
75 changes: 47 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</p>

<p align=center>
<img align=center src=https://github.com/deep5050/random-shits-happen-here/assets/27947066/250dcd05-c142-442a-a9a3-66347adb69c5 >
<img align=center src=https://user-images.githubusercontent.com/27947066/271250790-291c02fa-e568-45c8-8097-72167a109b82.png width=550px>
<hr>
<img alt="GitHub" src="https://img.shields.io/github/license/deep5050/radio-active?style=for-the-badge">
<img alt="PyPI" src="https://img.shields.io/pypi/v/radio-active?style=for-the-badge">
Expand All @@ -38,8 +38,8 @@
- [x] Finds nearby stations
- [x] Discovers stations by genre
- [x] Discovers stations by language
- [x] Record audio from live radio on demand :zap:
- [ ] 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 @@ -75,7 +75,7 @@ I encourage you to install with pipx: `pipx install radio-active`

### Run

Run with `radioactive --station [STATION_NAME]` or as simply `radio -U [UUID] ` :zap:
Run with `radioactive --search [STATION_NAME]` or as simply `radio -U [UUID] ` :zap:

### Tips

Expand All @@ -95,40 +95,63 @@ Run with `radioactive --station [STATION_NAME]` or as simply `radio -U [UUID] `
### Options


| Argument | Note | Description | Default |
| ---------------------------- | ----------------------------------- | -------------------------------------------- | ------- |
| `--station`, `-S` | Required (Optional from second run) | Station name | None |
| `--uuid`, `-U` | Optional | ID of the station | None |
| `--log-level`, `-L` | Optional | Log level of the program | Info |
| `--add-station` , `-A` | Optional | Add an entry to fav list | False |
| `--show-favorite-list`,`-W` | Optional | Show fav list | False |
| `--add-to-favorite`,`-F` | Optional | Add current station to fav list | False |
| `--flush` | Optional | Remove all the entries from fav list | False |
| `--discover-by-country`,`-D` | Optional | Discover stations by country code | False |
| `--discover-by-state` | Optional | Discover stations by country state | False |
| `--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 | 80 |
| `--kill` | Optional | Kill background radios. | False |

| Argument | Note | Description | Default |
| ----------------------------- | ----------------------------------- | ---------------------------------------------- | ----------------------- |
| `--search`, `-S` | Required (Optional from second run) | Station name | None |
| `--play`, `-P` | Optional | A station from fav list or url for direct play | None |
| `--last` | Optional | Play last played station | False |
| `--uuid`, `-U` | Optional | ID of the station | None |
| `--loglevel` | Optional | Log level of the program | Info |
| `--add` , `-A` | Optional | Add an entry to fav list | False |
| `--list`, `-W` | Optional | Show fav list | False |
| `--favorite`, `-F` | Optional | Add current station to fav list | False |
| `--flush` | Optional | Remove all the entries from fav list | False |
| `--country`, `-C` | Optional | Discover stations by country code | False |
| `--state` | Optional | Discover stations by country state | False |
| `--tag` | Optional | Discover stations by tags/genre | False |
| `--language` | optional | Discover stations by | False |
| `--limit` | Optional | Limit the # of results in the Discover table | 100 |
| `--volume` , `-V` | Optional | Change the volume passed into ffplay | 80 |
| `--kill` , `-K` | Optional | Kill background radios. | False |
| `--record` , `-R` | Optional | Record a station and save to file | False |
| `--filename`, `-N` | Optional | Filename to used to save the recorded audio | None |
| `--filepath` | Optional | Path to save the recordings | /User/Music/radioactive |
| `--filetype`, `-T` | Optional | Format of the recording (mp3/wav) | mp3 |
| | | | |
<hr>


> `--station`, `-S` : Expects a station name to be played (if not provided it
> will try to get the last played station). Example: "pehla nasha" ,
> `--search`, `-S` : Expects a station name to be played . Example: "pehla nasha" ,
> pehla_nasha, bbc_radio
> `--play`, `-P`: You can pass an exact name from your favorite stations or alternatively pass any direct stream url. This would bypass any user slection menu (useful when running from another srcipt)
> `--uuid`,`-U` : When station names are too long or confusing (or multiple
> 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
> greater priority than `--search`. Example: 96444e20-0601-11e8-ae97-52543be04c81
> `--log-level`, `-L` : don't need to specify unless you are developing it. `info` , `warning` , `error` , `debug`
> `--loglevel`, : 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.
### Runtime Commands

Input a command during the radio playback to perform an action. Available commands are:

```
Enter a command to perform an action: ?
q/Q/x/quit: Quit radioactive
h/H/help/?: Show this help message
r/R/record: Record a station
f/F/fav: Add station to favorite list
rf/RF/recordfile: Speficy a filename for the recording
```


> **TIP**: when using `rf`: specify the format of the output using the name. for example: "new-show.mp3" or "new-show.wav"
### Changes

Expand All @@ -140,10 +163,6 @@ Share you favorite list with our community 🌐 ➡️ [Here](https://github.com

> Your favorite list `.radio-active-alias` is under your home directory as a hidden file :)
### Extra

If you ever face a situation where radio-active quits but the audio (ffplay) runs in the background. Kill the process ID (PID) of ffplay. Run `ps -al` get the PID of ffplay and `kill [PID]`. I know you Know that :)


### Support

Expand Down
7 changes: 0 additions & 7 deletions install.sh

This file was deleted.

Loading

0 comments on commit 6090a16

Please sign in to comment.