Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework config and save to playlist arg #68

Merged
merged 14 commits into from
Mar 9, 2020
Merged

Rework config and save to playlist arg #68

merged 14 commits into from
Mar 9, 2020

Conversation

Badgie
Copy link
Owner

@Badgie Badgie commented Mar 6, 2020

Decided to rework the config files as well, so this PR will be a bit more comprehensive than expected.

  • Rework config to use one file, rather than 5 - see below
    • This is managed through conf.py.
  • Make config modifying argument names more uniform
    • Most (sans blacklist) will follow a --[remove|save]-TYPE scheme.
  • Make functions relevant to the above arguments more uniform
  • Added function that converts old config to new
  • Allow adding and removing currently playing track to specific playlist
  • Allow saving and removing playlists in config
  • Update README
  • Use case test on everything
    • no-arg with and without n
    • -a with and without seed size
    • -t with and without seed size
    • -ac
    • -tc
    • -gc
    • -gcs
    • -c with different type inputs
    • -s
    • -sr
    • --add-to with saved list and uri
    • --remove-from with saved list and uri
    • --save/remove-playlist
    • --save/remove-device
    • --save/remove/load-preset
    • -l with any
    • --tune with any
    • --play
    • -b, -br, -bc
    • all --print

Config structure:

$ cat ~/.config/spotirec/spotirec.conf
[spotirecoauth]
access_token = str
token_type = str
expires_in = int
refresh_token = str
scope = str
expires_at = int

[presets]
preset-id = dict

[blacklist]
tracks =dict
artists = dict

[devices]
device-id = dict

[playlists]
playlist-id = dict

Stuff to fix when merging the remaining PRs:

  • Implement graceful keyboard interrupt handling for new input prompts
  • Maybe set default playlist as a saved playlist

@Badgie Badgie linked an issue Mar 6, 2020 that may be closed by this pull request
@falkecarlsen falkecarlsen changed the base branch from master to dev March 6, 2020 19:45
@Badgie Badgie added this to the v1.2 milestone Mar 6, 2020
@Badgie Badgie marked this pull request as ready for review March 7, 2020 09:46
@Badgie Badgie requested a review from falkecarlsen March 7, 2020 13:34
This was referenced Mar 9, 2020
Copy link
Collaborator

@falkecarlsen falkecarlsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pedantic stuff, otherwise very nice!

README.md Outdated Show resolved Hide resolved
conf.py Show resolved Hide resolved
conf.py Outdated Show resolved Hide resolved
Badgie and others added 3 commits March 9, 2020 23:09
@Badgie Badgie merged commit aa9075b into dev Mar 9, 2020
@Badgie Badgie deleted the save-to-playlist branch March 10, 2020 14:22
Badgie added a commit that referenced this pull request Mar 11, 2020
* Rework config and save to playlist arg (#68)

* rework config file & make config-modifying arguments more uniform

* add custom config parser

* finalize new config structure

* clean up conf file and add some print output

* allow adding and removing currently playing track to input playlist

* update readme

* reformat some older functions

* minor bug fixes

* add and update comments

* update intro text in readme

* remove redundant non-positional parameter assignments in function calls

* Update conf.py

Co-Authored-By: Falke Carlsen <[email protected]>

* update readme

Co-authored-by: Falke Carlsen <[email protected]>

* resolve conflicts

* resolve conflicts

* resolve conflicts

* Track feature printing (#75)

* rework config file & make config-modifying arguments more uniform

* add custom config parser

* finalize new config structure

* clean up conf file and add some print output

* allow adding and removing currently playing track to input playlist

* update readme

* reformat some older functions

* minor bug fixes

* add and update comments

* update intro text in readme

* remove redundant non-positional parameter assignments in function calls

* allow printing track features

* Enhance tune validation (#74)

* rework config file & make config-modifying arguments more uniform

* add custom config parser

* finalize new config structure

* clean up conf file and add some print output

* allow adding and removing currently playing track to input playlist

* update readme

* reformat some older functions

* minor bug fixes

* add and update comments

* update intro text in readme

* remove redundant non-positional parameter assignments in function calls

* enhance validity check of tunining

* add version flag (#61)

* remove whitespace error in custom schemes (#62)

* Single playlist (#65)

* use single playlist

* update readme

* Add tuning option to print (#67)

* add tuning option to print

* update readme to reflect install changes

* spelling

* Catch keyboard interrupts (#60)

* catch keyboard interrupts

* catch interrupt on new input prompts

* add flag for changing playback device (#77)

* notify when recommendation yields few different tracks (#78)

* fix minor things before release

Co-authored-by: Falke Carlsen <[email protected]>
Badgie added a commit that referenced this pull request Mar 22, 2020
* Version 1.2 (#80)

* Rework config and save to playlist arg (#68)

* rework config file & make config-modifying arguments more uniform

* add custom config parser

* finalize new config structure

* clean up conf file and add some print output

* allow adding and removing currently playing track to input playlist

* update readme

* reformat some older functions

* minor bug fixes

* add and update comments

* update intro text in readme

* remove redundant non-positional parameter assignments in function calls

* Update conf.py

Co-Authored-By: Falke Carlsen <[email protected]>

* update readme

Co-authored-by: Falke Carlsen <[email protected]>

* resolve conflicts

* resolve conflicts

* resolve conflicts

* Track feature printing (#75)

* rework config file & make config-modifying arguments more uniform

* add custom config parser

* finalize new config structure

* clean up conf file and add some print output

* allow adding and removing currently playing track to input playlist

* update readme

* reformat some older functions

* minor bug fixes

* add and update comments

* update intro text in readme

* remove redundant non-positional parameter assignments in function calls

* allow printing track features

* Enhance tune validation (#74)

* rework config file & make config-modifying arguments more uniform

* add custom config parser

* finalize new config structure

* clean up conf file and add some print output

* allow adding and removing currently playing track to input playlist

* update readme

* reformat some older functions

* minor bug fixes

* add and update comments

* update intro text in readme

* remove redundant non-positional parameter assignments in function calls

* enhance validity check of tunining

* add version flag (#61)

* remove whitespace error in custom schemes (#62)

* Single playlist (#65)

* use single playlist

* update readme

* Add tuning option to print (#67)

* add tuning option to print

* update readme to reflect install changes

* spelling

* Catch keyboard interrupts (#60)

* catch keyboard interrupts

* catch interrupt on new input prompts

* add flag for changing playback device (#77)

* notify when recommendation yields few different tracks (#78)

* fix minor things before release

Co-authored-by: Falke Carlsen <[email protected]>

* fix error with blacklist being generated incorrectly (#81)

* add logger class

* change info colour

* convert print messages

* implement switches

* add newline to log file print

* add shorthands of verbose/quiet

* add verbose and debugging prints

* use file only with log flag and on crash

* update readme

* add more comprehensive debugging msgs for requests

* add a few debug messages

* add more debugs

* add log level names for debugging purposes

* remove base64 debug

Co-authored-by: Falke Carlsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add currently playing track to input playlist
2 participants