Giter Site home page Giter Site logo

spotui's People

Contributors

ceuk avatar dbkosky avatar dependabot[bot] avatar octoshrimpy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

spotui's Issues

start_playback has it's context_uri and track_uri parameters reversed

Describe the bug
start_playback has it's context_uri and track_uri parameters reversed
they are now

def start_playback(self,
                       device_id,
                       track_uri=None,
                       context_uri=None,
                       offset=None):

but they should be

def start_playback(self,
                       device_id,
                       context_uri=None,
                       track_uri=None,
                       offset=None):

Can't control playback

I set spotui up like the readme shows. It shows what song is playing and I can browse through my playlists etc. But I can't control the playback.

My Setup:

  • Ubuntu 19.10
  • Spotify Free (maybe that's the problem)
  • Web player as "demon"
  • Default Gnome Terminal

Non-Latin characters problems

Describe the bug
Some non-Latin characters break the section delimiters and the artists list alignment, and other characters aren't displayed how they should, as shown in the screenshot.

To Reproduce
Search any title that has non-Latin characters and/or play any song to see the progress bar characters issues.

Screenshots
Here you can see how Japanese characters break the right delimiters of the current playlist section and also the artists list alignment. In the song's progress bar you can see how the bar ends aren't shown how they're supposed to (in the screenshot they're displayed as Ξ© and Ξ¦), along with the play and shuffle icons at the left of the current song title (in the screenshot they're displayed as Chinese characters).
issue

Desktop

  • OS: Linux Mint 20.3 (Cinnamon)

Additional context
This happens no matter what font I use for the terminal.

TypeError raised when no songs have yet been played

Describe the bug
When selecting "recently played" and nothing has yet been played (due to an inablility to play any tracks; I'm working on debugging it since it might actually be my fault, idk, if not, I'll submit a report shortly) the program craashes with the a TypeError.

❯ python3 spotui
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "spotui/__main__.py", line 10, in <module>
    main()
  File "spotui/__main__.py", line 6, in main
    SpoTUI = curses.wrapper(App)
  File "/usr/lib/python3.5/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/user/.local/lib/python3.5/site-packages/spotui/src/ui.py", line 8, in __init__
    self.main_form = MainForm(stdscr)
  File "/home/user/.local/lib/python3.5/site-packages/spotui/src/MainForm.py", line 98, in __init__
    key)
  File "/home/user/.local/lib/python3.5/site-packages/spotui/src/LibraryMenu.py", line 61, in receive_input
    self.items[self.component.selected]["handler"]()
  File "/home/user/.local/lib/python3.5/site-packages/spotui/src/LibraryMenu.py", line 54, in __select_recent_tracks
    "Recently Played")
  File "/home/user/.local/lib/python3.5/site-packages/spotui/src/MainForm.py", line 123, in change_tracklist
    self.components[0].update_tracks(tracks, title)
  File "/home/user/.local/lib/python3.5/site-packages/spotui/src/TracksMenu.py", line 30, in update_tracks
    self.items = list(map(self.__map_tracks, tracks))
TypeError: 'NoneType' object is not iterable

To Reproduce
Steps to reproduce the behavior:

  1. Fresh install
  2. python3 spotui in ~/.local/lib/python3.5/site-packages
  3. Don't play any tracks
  4. Select "Recently played"

Expected behavior
The program should fail gracefully.

Desktop (please complete the following information):

  • OS: ChromeOS 79 with Debian Stretch VM (via native "linux (beta)" feature)
  • Browser: Chrome 79

Additional context
I think that covers it.

User Themes

Using the existing patterns in config.py and colors.py implement a new config section: "theme" that allows users to define the terminal color using the ncurses constant names. These config values should be plugged into colors.py (replacing the hardcoded values) if they are present.

e.g.

[theme]
progress_bar_fg = "COLOR_GREEN"
progress_bar_bg = "COLOR_BLACK"
border_fg = "COLOR_WHITE"
border_bg = "COLOR_BLACK"
border_active_fg = "COLOR_YELLOW"
# ...etc

We will also need to define a set of themeable colors as currently the colors file and use thereof isn't very organised (Basically, we need to make sure that we have a pair defined for each semantic UI element: e.g. progress bar etc - and that we update the pairs being used by these elements accordingly)

IndexError Traceback when hitting Enter to exit empty devices popup

Describe the bug
spotui will exit with a Traceback if you hit enter in the devices popup and there are no active devices.

To Reproduce
Steps to reproduce the behavior:

  1. Ensure there are no active spotify devices
  2. Open spotui
  3. Hit d to open devices popup
  4. Hit Enter

Expected behavior
I would expect the empty box to close without attempting to make a selection if there are no devices to choose from, i.e. it should behave like hitting Escape when there aren't active devices.

Desktop:

➜  ~ uname -a
Linux backlog 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64 GNU/Linux
➜  ~ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
VERSION_CODENAME=stretch
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Additional context
Hit enter after this point:
Screenshot_2020-01-10_10-21-00

Traceback:

➜  ~ spotui
Traceback (most recent call last):
  File "/home/trey/.local/bin/spotui", line 11, in <module>
    sys.exit(main())
  File "/home/trey/.local/lib/python3.5/site-packages/spotui/__main__.py", line 6, in main
    SpoTUI = curses.wrapper(App)
  File "/usr/lib/python3.5/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/trey/.local/lib/python3.5/site-packages/spotui/src/ui.py", line 8, in __init__
    self.main_form = MainForm(stdscr)
  File "/home/trey/.local/lib/python3.5/site-packages/spotui/src/MainForm.py", line 88, in __init__
    self.popup.receive_input(key)
  File "/home/trey/.local/lib/python3.5/site-packages/spotui/src/DeviceMenu.py", line 49, in receive_input
    self.items[self.component.selected]["handler"]()
IndexError: list index out of range

The latest version of Spotipy has to be installed separately when setting up for the first time.

The version of Spotipy on PyPi is outdated and I'm not sure how to specify the Github version as a dependency in my Pipfile so that it will automatically be installed when running pip install on Spotui.

I'm sure there's a way, it's just down to my inexperience with Python dependency management. I'll leave this issue open in case anyone can provide some assistance while I figure it out.

Search is still intermittently breaking

Occasionally the search box UI will close itself but user input will continue to be directed to the now invisible text box.

This is likely due to one of the following:

  • The redraw loop is resuming when it shouldn't clearing the UI.
  • The curses window used to house the Textbox is not being deleted on enter key.

My play button is changing to Chinese character

Describe the bug
My play button is changing to Chinese character, and the progress bar is not working

ο€‰ο¦ž Afterglow - Ed Sheeran 02:22/03:05
ξ‚Άβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ ξ‚΄

Playlists capped at 50

Is your feature request related to a problem? Please describe.
Only around 52 playlists are visible, out of the 80+

Describe the solution you'd like
Either list all playlists in a flattened directory, or integrate with spotify-folder to provide a better view.

Describe alternatives you've considered
I've migrated to spotui from spotify-tui (even though I prefer the arrow nav from *-tui) simply because this is python and I don't know rust πŸ˜… this way I can help contribute.

Additional context
for smaller screens, scrolling name of playlists, songs & artists would be very beneficial as well, since there are a lot of songs with naming schemas such as mihoy remix - Renegade: <song name> and in smaller screens the user simply gets mihoy remix - Renega...


I'd also like to help where I can towards theming, as this is what mine looks like at the moment:
image

Crash upon providing URL

Describe the bug
Spotui crashes after configuring and providing the 'broken link'

To Reproduce

  1. Install spotui
  2. Configure .spotuirc
  3. Launch spotui and provide the link you were redirected to
  4. Spotui crashes

Stack trace

Traceback (most recent call last):
  File "/usr/bin/spotui", line 6, in <module>
    from spotui.__main__ import main
  File "/usr/lib/python3.8/site-packages/spotui/__main__.py", line 2, in <module>
    from spotui.src.ui import App
  File "/usr/lib/python3.8/site-packages/spotui/src/ui.py", line 1, in <module>
    from spotui.src.MainForm import MainForm
  File "/usr/lib/python3.8/site-packages/spotui/src/MainForm.py", line 4, in <module>
    from spotui.src.spotifyApi import SpotifyApi
  File "/usr/lib/python3.8/site-packages/spotui/src/spotifyApi.py", line 220, in <module>
    client = SpotifyApi()
  File "/usr/lib/python3.8/site-packages/spotui/src/spotifyApi.py", line 10, in __init__
    self.auth()
  File "/usr/lib/python3.8/site-packages/spotui/src/spotifyApi.py", line 19, in auth
    self.token = util.prompt_for_user_token(
  File "/usr/lib/python3.8/site-packages/spotipy/util.py", line 86, in prompt_for_user_token
    token_info = sp_oauth.get_access_token(code)
  File "/usr/lib/python3.8/site-packages/spotipy/oauth2.py", line 217, in get_access_token
    raise SpotifyOauthError(response.reason)
spotipy.oauth2.SpotifyOauthError: Bad Request

Cannot play tracks on Chromebook.

Describe the bug
Okay, I have no idea what I'm getting wrong, but I can't play any tracks. This might have to do with my system since it's ChromeOS, but I really don't know. Linux is supposed to be able to interface with the sound.
Works: fetching playlists, songs, top tracks, etc. Search. All keybindings, etc.
Doesn't work: Showing/selecting devices (I have both the official PWA and spotifyd running), detecting if another client is playing a song (always says "nothing is playing", despite songs playing on web client or phone), and playing songs. The bind to start a track is Enter, right?

To Reproduce
Steps to reproduce the behavior:
I followed the instructions in the README with exactness. Like I said before, this could just be my system.

Expected behavior
Being able to play tracks.

Screenshots
image
I had a song playing then, via the PWA.
image
Yes, I did have spotifyd running right then. I used ps -aux to check.

Desktop (please complete the following information):

  • OS: ChromeOS 79 with Debian 9 (Stretch) VM/container (built-in "Linux (beta)" feature)
  • Browser Chrome 79

Chromebook C330

Additional context
Does spotifyd require configuration?
If this is just a problem with my system, could someone maybe reproduce and try to figure it out? I understand if you don't have a Chromebook, but this is just frustrating.

Play, repeat and shuffle come up as Chinese/Japanese characters

I don't know if this is because of the shell I'm using or not. My default shell is FISH. I suspect this is due to differences in how Unicode is handled. After submitting this, I'll check if Bash has the same error.

(PS - this is rad and I love it)

OS: Manjaro Linux
Kernel: 5.4.13-3-MANJARO
Shell: fish 3.0.2
Terminal: cool-retro-term (also happens in Konsole)

EDIT: Also happens in Bash. Not shell dependent, and not terminal dependent

How I can see spotui version and upgrade it?

Describe the bug
I'm not able to see version and upgrade it. There is no documentation about it.

I recommend to improve the README file.

To Reproduce
Steps to reproduce the behavior:

spotui -v | --version

Expected behavior
See version

Desktop (please complete the following information):

  • OS: macos monterrey

Artist names don't align if track title is too long

Describe the bug
When a track title is long enough that it gets cut off, the artist's name is shifted one column.

To Reproduce
Steps to reproduce the behavior:

  1. Find any track with a long title
  2. Make your terminal window smallish

Expected behavior
All artist's names should line up.

Screenshots
image
See the second-to bottom's artist name is shifted one column.

Desktop (please complete the following information):

  • OS: Linux (Clear Linux version 32270)
  • Browser Firefox (not that it matters)
  • Version: SpoTUI 0.1.10

Auto-scroll truncated text

When text is truncated it should automatically scroll left and right on an interval.

E.g. given the text "Never gonna give you up - Rick Astley"

You would move the truncation offset about 1 character every 500ms until the end is reached (at which point it should reverse).

There should also be a short delay (2 seconds or so) when the truncation offset reaches 0 again.

e.g. (the bar represents the truncation)

Never gonna give you up - Rick Astley
| ---------------- |

rendered: Never gonna give...

~500ms later:

Never gonna give you up - Rick Astley
  | ---------------- |

rendered: ever gonna give ...

~500ms later:

Never gonna give you up - Rick Astley
    | ---------------- |

rendered: ver gonna give y...

... etc

NoneType object not iterable when using spotifyd

Just started spotifyd, got this new error:

Traceback (most recent call last):
  File "spotui", line 8, in <module>
    sys.exit(main())
  File "/home/harrison/.local/lib/python3.8/site-packages/spotui/__main__.py", line 6, in main
    SpoTUI = curses.wrapper(App)
  File "/usr/lib/python3.8/curses/__init__.py", line 105, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/harrison/.local/lib/python3.8/site-packages/spotui/src/ui.py", line 8, in __init__
    self.main_form = MainForm(stdscr)
  File "/home/harrison/.local/lib/python3.8/site-packages/spotui/src/MainForm.py", line 51, in __init__
    PlaylistMenu(stdscr, self.api, self.change_tracklist),
  File "/home/harrison/.local/lib/python3.8/site-packages/spotui/src/PlaylistMenu.py", line 15, in __init__
    self.restart()
  File "/home/harrison/.local/lib/python3.8/site-packages/spotui/src/PlaylistMenu.py", line 26, in restart
    list(map(self.__map_playlists, self.items)),
TypeError: 'NoneType' object is not iterable

Error persists eve after stopping spotifyd and/or un-and re-installing spotui library.
Desktop:

  • OS: Linux
  • Version SpoTUI 0.1.10

Localhost refused to connect

To Reproduce
Steps to reproduce the behavior:

  1. spotui
  2. redirect... (http://localhost:8888/Proladon, setting both .spotuirc and soptify dashboard)
    (and also tried 127.0.0.1)
  3. showing authorization
  4. Click agree
  5. localhost refused to connect.

Screenshots
image

Desktop (please complete the following information):

  • OS: Win10

Additional context
Btw, Windows should install windows-curses
or it will show no module named '_curses'

Issues when running the command "spotui"

I'm getting these errors logs when I run the SPOTUI command.

I'm currently using python 3.9.0 [64b], pip 21.1.3 [the latest version], and the latest version of windows 10.

Capture

Play/Pause, Prev/Next, not working at all

Describe the bug
When spotui is launched, it does run, show songs, navigation works as well
But when the song is played, it doesn't play
It looks as if no keys have been pressed.

To Reproduce
Steps to reproduce the behavior:
I do not have any ideas. As far as I can see, there are no logs, nothing. It just decides to stop working.

Expected behavior
Play/Pause, Next/Previous commands should work

Desktop (please complete the following information):

  • OS: Gentoo Linux (can reproduce this on both OpenRC and systemd)
  • Browser: Firefox
  • Version 0.1.17

Octo's Megalist of Stuff

This is a list I compiled from small things I noticed don't quite work, or features from other TUI clients that can be imported with relative ease. None of this is final, but for other devs seeing this, if you know how to do one, please comment or send a PR.


╔════════════════════
╏ todo
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

  • nav not intuitive: tab changes panels, LR changes seekbar, UD changes cursor

  • play/pause icons are inverted from what spotify has
    doesn't make sense to keep the icon there since' it's not clickable
    replace the icon with a loader (braille 4-sq spinner) when playing

  • exit search with [esc]

  • no padding above and below the entire app

  • if "nothing is playing" is perma-visible, shouldn't search also be?
    0:0/0:0 probably shouldn't be visible if nothing is playing
    remove play bar, center "nothing is playing" vertically with the color of bar

  • use elipsis character … to squeeze one more letter out of long names

  • open modal with keybinds on ?

  • horizontal scroll of text on long names if hovered - tracked in #23
    https://www.youtube.com/watch?v=FGcZeVDWXR0

  • playlists capped at 50 shouldn't be a thing

  • playlist folders - tracked in #21
    https://github.com/mikez/spotify-folders

image

  • rounded corners vs square

image

image

  • arrow navigation for panels
    this will require two colors for borders: hovered & selected
    make playlist screen wider if focused?

  • migrate next big version to blessings?
    https://github.com/erikrose/blessings

  • remove delay from esc when closing popups
    https://stackoverflow.com/questions/27372068/why-does-the-escape-key-have-a-delay-in-python-curses

  • remove esc as a method to close the app. (spamming esc to close menus)

  • quick actions menu for those still learning/not wanting to learn keybinds
    ie: if cursor is on playlist, show playlist actions

  • more steps in seekbar so it doesn't feel as jumpy, replace β–‘ with curses " " + bg color
    7 steps: β–β–Žβ–β–Œβ–‹β–Šβ–‰
    2 steps: β †β Ά, ⑇⑷, ⑇⣿, ⑁⣉

╔════════════════════
╏ done
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

  • custom colors + theme engine - tracked in #22
    instead, check if xterm256, and then use a custom color profile

  • current device icon

Podcast Support

Currently, podcasts (shows) appear in search results. The logic to handle playing a show, setting the context etc just needs implementing. Feel free to πŸ‘ this issue to pressure me to get this done πŸ˜„

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.