Skip to content

aetheldev/music-player.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Music player (Spotify) for neovim

  • authorize

    • For Code code opens default browser but behind the scene i make lua server so i can get the code.
    • access_token and refresh_token saved in .config/nvim/music-player-credentials.json
  • :MPlayer & require("music-player").authorize()

  • :MPlayerCurrentSong & require("music-player").get_current_song()

    • Notify about song state and artist - song name
  • :MPlayerStart & require("music-player").start_polling()

    • Creates timer and checks :MPlayerCurrentSong every 5 secs
  • :MPlayerStop & require("music-player").stop_polling()

    • Stops timer

Player

  • :MPlayerPlay
  • :MPlayerPause
  • :MPlayerNext
  • :MPlayerPrev

FILE

  • :MPlayerClean
    • removes saved file.

TODOS

Building Steps

  • Create repo
  • Create basic folder structure
  • Naming is hard what should I name it

Login stuff

  • login spotify is pain in the ass
  • redirect user to get code or something
  • get Code somehow and connect the spotify
  • save the data what we have given
  • create server that lisen on that redirect url and get the code(be smart).
  • Get information https://api.spotify.com/v1/me/player/currently-playing
  • Print console basic information such as what is playing
  • Instead using console, toast it information with vim.notify
  • PKCE ????????? you don't need something like client secret ?

Functions

  • create fn that shows currently playing
  • create fn maybe goes next or prev?
  • create fn maybe pause?
  • create track last song every 5 sec if changed notify!
  • right now we are checking every 5 sec songs, we might need check if user inactive if user afk we should stop requesting.

Finishing

  • Bind fn's together so anyone can use
  • After learn LUA refactor this garbage

Bugs!

  • Some times in utils.timer -> vim.schedule_wrap fails and gives error about currently playing unfinished or something.

About

Spotify tracking songs for neovim

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages