deep5050 / radio-active

Play any radios around the globe right from the terminal :zap:
https://www.radio-browser.info/#/
MIT License
469 stars 24 forks source link

Show current song #78

Closed l-wegner closed 8 months ago

l-wegner commented 9 months ago

This pull request should address #75

I added also a command to start and stop the current station.

I did not find any rules, how to contribute, so it's that informal now. :)

Edit: I had to force push, because I forgot the --signoff

github-actions[bot] commented 9 months ago

Hi, @l-wegner, Thanks for opening this PR :blue_heart: . Contributors :people_holding_hands: like you make the open source community :earth_africa: such an amazing place to learn :book: , inspire :angel:, and create :art: . We will review it :eyes: and get back to you as soon as possible :+1: . Just make sure you have followed the contribution guidelines.

By that time enjoy this meme :point_down: , hope you like it :smile:

meme

Use this action on your projects. Use jokes on issues instead.

deep5050 commented 9 months ago

Thank you sooo much for the PR. really appreciate it.

I see several bugs in the PR:

  1. current station panel is showing after the command menu
  2. after I stop a station, it again shows the panel
c/Users/Dipankar$ radio
╭─────────────────────────────────── RADIOACTIVE ───────────────────────────────────╮
│                                                                                   │
│         📻 Play any radios around the globe right from this Terminal ⚡!          │
│         😄 Author: Dipankar Pal                                                   │
│         ❓ Type '--help' for more details on available commands                   │
│         🐛 Visit: https://github.com/deep5050/radio-active to submit issues       │
│         ⭐ Show some love by starring the project on GitHub ❤                     │
│         💵 You can donate me at https://deep5050.github.io/payme/                 │
│         ❌ Press Ctrl+C to quit                                                   │
│                                                                                   │
╰───────────────────────────────────────────────────────────────────────────────────╯
      i     | You can search for a station on internet using the --search option
      i     | Press '?' to see available commands
Enter a command to perform an action:
╭─────────────────────────────────────── 📻 ────────────────────────────────────────╮
│                                 RADIO MARIA INDIA                                 │
│                                     undefined                                     │
╰───────────────────────────────────────────────────────────────────────────────────╯
s

╭─────────────────────────────────────── 📻 ────────────────────────────────────────╮
│                                 RADIO MARIA INDIA                                 │
│                                     undefined                                     │
╰───────────────────────────────────────────────────────────────────────────────────╯
      i     | Radio playback stopped successfully
Enter a command to perform an action: ╭─────────────────────────────────────── 📻 ────────────────────────────────────────╮
│                                 RADIO MARIA INDIA                                 │
│                                     undefined                                     │
╰───────────────────────────────────────────────────────────────────────────────────╯
  1. new panel is showing up on every new title

Type the result ID to play: 90 i | Station found: Auckland 80s i | Press '?' to see available commands Enter a command to perform an action: ╭─────────────────────────────────────── 📻 ────────────────────────────────────────╮ │ Auckland 80s │ │ Duran Duran - The Wild Boys │ ╰───────────────────────────────────────────────────────────────────────────────────╯

╭─────────────────────────────────────── 📻 ────────────────────────────────────────╮ │ Auckland 80s │ │ R.E.M. - Fall On Me │ ╰───────────────────────────────────────────────────────────────────────────────────╯


4. showing undefined when song information is not available. show be blank

```bash
╭─────────────────────────────────────── 📻 ────────────────────────────────────────╮
│                                 RADIO MARIA INDIA                                 │
│                                     undefined                                     │
╰───────────────────────────────────────────────────────────────────────────────────╯

we need to resolve thse

deep5050 commented 9 months ago
Enter a command to perform an action:
╭─────────────────────────────────────── 📻 ────────────────────────────────────────╮
│                                   Auckland 80s                                    │
│                            Duran Duran - The Wild Boys                            │
╰───────────────────────────────────────────────────────────────────────────────────╯

╭─────────────────────────────────────── 📻 ────────────────────────────────────────╮
│                                   Auckland 80s                                    │
│                                R.E.M. - Fall On Me                                │
╰───────────────────────────────────────────────────────────────────────────────────╯
    [!!!]   | Error while reading current track: string index out of range

╭─────────────────────────────────────── 📻 ────────────────────────────────────────╮
│                                   Auckland 80s                                    │
│                                R.E.M. - Fall On Me                                │
╰───────────────────────────────────────────────────────────────────────────────────╯

╭─────────────────────────────────────── 📻 ────────────────────────────────────────╮
│                                   Auckland 80s                                    │
│                                R.E.M. - Fall On Me                                │
╰───────────────────────────────────────────────────────────────────────────────────╯
deep5050 commented 9 months ago

c/Users/Dipankar$ radio --search india
╭─────────────────────────────────── RADIOACTIVE ───────────────────────────────────╮
│                                                                                   │
│         📻 Play any radios around the globe right from this Terminal ⚡!          │
│         😄 Author: Dipankar Pal                                                   │
│         ❓ Type '--help' for more details on available commands                   │
│         🐛 Visit: https://github.com/deep5050/radio-active to submit issues       │
│         ⭐ Show some love by starring the project on GitHub ❤                     │
│         💵 You can donate me at https://deep5050.github.io/payme/                 │
│         ❌ Press Ctrl+C to quit                                                   │
│                                                                                   │
╰───────────────────────────────────────────────────────────────────────────────────╯
     [!]    | showing 18 stations with the name!
┏━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ID ┃ Station                                               ┃ Country ┃                    Tags                     ┃
┡━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 1  │ 1.FM - Bombay Beats India Radio                       │   CH    │                  bollywood                  │
│ 2  │ All India Radio AIR Bilaspur                          │   IN    │                                             │
│ 3  │ All India Radio AIR Punjabi                           │   IN    │                india,punjabi                │
│ 4  │ Blu Radio, señal nacional (HJCK, 89.9 MHz FM, Bogo... │   CO    │ armenian,bogotá,caribbean music,live spo... │
│ 5  │ caprice indian folk                                   │   RU    │                                             │
│ 6  │ Indiana Country 101.5 WKKG                            │   US    │                   country                   │
│ 7  │ Indiana Public Radio WBST                             │   US    │              npr,public radio               │
│ 8  │ New Delhi India TV                                    │   IN    │                                             │
│ 9  │ Radio Caprice - Indian Cinema Music                   │   RU    │ bollywood,film music,hindi,movie soundtr... │
│ 10 │ Radio Caprice - indian folk                           │   RU    │                indian music                 │
│ 11 │ Radio Caprice - Indian Spiritual Music                │   RU    │        ethnic,folk,mantra,spiritual         │
│ 12 │ RADIO MARIA INDIA                                     │   IN    │           catholic,religion,talk            │
│ 13 │ WFIU 103.7 Indiana Public Media - Bloomington, IN     │   US    │ apm,bloomington,classical,jazz,npr,pri,p... │
│ 14 │ WFIU-HD2 Indiana Public Media - Bloomington, IN       │   US    │    bbc,bloomington,npr,pri,public radio     │
│ 15 │ WFYI 90.1 Indianapolis, IN                            │   US    │ bbc,indianapolis,news,npr,public radio,t... │
│ 16 │ WIBC 93.1 Indianapolis, IN                            │   US    │           indianapolis,news talk            │
│ 17 │ WIOE Oldies 101.1 South Whitley, Indiana              │   US    │                                             │
│ 18 │ WXLW 950 "Freedom 95" Indianapolis, IN                │   US    │ conservative,finance,local weather,news,... │
└────┴───────────────────────────────────────────────────────┴─────────┴─────────────────────────────────────────────┘
      i     | If the table does not fit into your screen,
      i     | try to maximize the window , decrease the font by a bit and retry
Type the result ID to play: 3
      i     | Station found: All India Radio AIR Punjabi
      i     | Press '?' to see available commands
Enter a command to perform an action:     [!!!]   | Error while reading current track: string index out of range

    [!!!]   | Error while reading current track: string index out of range
╭─────────────────────────────────────── 📻 ────────────────────────────────────────╮
│                            All India Radio AIR Punjabi                            │
│           Error while reading current track: string index out of range            │
╰───────────────────────────────────────────────────────────────────────────────────╯
    [!!!]   | Error while reading current track: string index out of range
    [!!!]   | Error while reading current track: string index out of range
    [!!!]   | Error while reading current track: string index out of range
    [!!!]   | Error while reading current track: string index out of range
deep5050 commented 8 months ago

i have implemented this as a runtime command on 2.9.0.

thanks for the PR. thanks for contributing