Default path for music_directory is now parsed from mpd.conf
This commit is contained in:
parent
a365ca8c08
commit
aba0dae95e
@ -14,7 +14,7 @@ var (
|
|||||||
"ADDITIONAL_PADDING_Y": 16,
|
"ADDITIONAL_PADDING_Y": 16,
|
||||||
"IMAGE_WIDTH_EXTRA_X": -1.5,
|
"IMAGE_WIDTH_EXTRA_X": -1.5,
|
||||||
"IMAGE_WIDTH_EXTRA_Y": -3.75,
|
"IMAGE_WIDTH_EXTRA_Y": -3.75,
|
||||||
"MUSIC_DIRECTORY": HOME_DIR + "/Music",
|
"MUSIC_DIRECTORY": getMusicDirectory(),
|
||||||
"PORT": "6600",
|
"PORT": "6600",
|
||||||
"DEFAULT_IMAGE_PATH": "default.jpg",
|
"DEFAULT_IMAGE_PATH": "default.jpg",
|
||||||
"COVER_IMAGE_PATH": "cover.jpg",
|
"COVER_IMAGE_PATH": "cover.jpg",
|
||||||
|
1
utils.go
1
utils.go
@ -94,6 +94,7 @@ func getMusicDirectory() string {
|
|||||||
for _, j := range maps {
|
for _, j := range maps {
|
||||||
if strings.Contains(j, "music_directory") {
|
if strings.Contains(j, "music_directory") {
|
||||||
s := strings.SplitAfter(strings.ReplaceAll(j, " ", ""), "y")[1]
|
s := strings.SplitAfter(strings.ReplaceAll(j, " ", ""), "y")[1]
|
||||||
|
s = strings.ReplaceAll(s, "\t", "")
|
||||||
d := ""
|
d := ""
|
||||||
for z, m := range s {
|
for z, m := range s {
|
||||||
if (z != 0) && (z != (len(s) - 1)) {
|
if (z != 0) && (z != (len(s) - 1)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user