mirror of
https://github.com/JakeStanger/mpd-discord-rpc.git
synced 2026-07-11 11:15:27 +01:00
[GH-ISSUE #18] Default fallback if missing from config #9
Labels
No labels
bug
enhancement
help wanted
package
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
JakeStanger/mpd-discord-rpc#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Kranzes on GitHub (Feb 22, 2022).
Original GitHub issue: https://github.com/JakeStanger/mpd-discord-rpc/issues/18
It would be nice if the program would fallback to the default options if they aren't defined in the
config.toml.For example, a
config.tomlwith this content:Should still work, and not crash the program. The program will then use the default options but replace the large_image option with the one defined in the config file.
@JakeStanger commented on GitHub (Feb 22, 2022):
This should already be the case, my bad for not spotting that in the PR that added those new options.
I will try and get that fixed tonight.Edit: Probs gonna push this back a few days, a few work bits have cropped up.@Kranzes commented on GitHub (Feb 22, 2022):
It is not the case only for the new options, the program crashes when just specifying:
@JakeStanger commented on GitHub (Feb 22, 2022):
Right yeah, because those ones were guaranteed to exist in a config unless removed. Will sort those ones too 👍
@Kranzes commented on GitHub (Feb 22, 2022):
Don't forget the stuff outside of
[format]too.@OliverKovacs commented on GitHub (Feb 23, 2022):
@JakeStanger I could take a look at this.
Maybe ditch the system with defaults.rs and make a default config toml and then merge its values to the values loaded from the user's config?
@JakeStanger commented on GitHub (Feb 23, 2022):
Yeah that'd be great! You could probably keep the defaults struct and just do a better job of merging that into the config struct, but if you think there's a better way go ahead and I'll have a review.