Schweinepriester / beets-config

Config for https://github.com/beetbox/beets
MIT License
2 stars 4 forks source link

Outsourcing directory and library #6

Closed Schweinepriester closed 9 years ago

Schweinepriester commented 9 years ago

to make it modular and we dont have to commit our paths

should be possible, see https://beets.readthedocs.org/en/v1.3.13/reference/config.html#configuration-location, but it seems not to work on windows (see sampsyo/beets#1504)

i think the goal should be to have BEETSDIR set to a config file where directory and library are configured and loading our combined config with beet -c PATHTOCONFIGFILE to have them both loaded

or, the other way around, loading our combined config as defined in BEETSDIR and importing the paths afterwards

@zabelhaft please try to load an additional config on mac osx. also: your thoughts?

Schweinepriester commented 9 years ago

alright, it does work, but needs to be specified each time:

$ beet --config foo.yaml list

which makes it impractical. or is there some way to call it always with some default parameters?

zabelhaft commented 9 years ago

how are we going to use beets?

write specific shell scrips and execute them or "learn" the beets syntax and type it ourselfs

i would prefer the interactive typing for now and postprone shell scrips to beta 1.

to accomodate this our config.yaml needs to be specific (since windows is buggy)

Schweinepriester commented 9 years ago

man könnte einen wrapper schreiben, sodass bei anruf von beet automatisch beet -c pathtoconfig/config.yaml aufgerufen wird

klar, das einfachste ist erstmal konkret zu sein

ich hatte in dem kontext auch überlegt ob wir vielleicht auch eine art build-prozess wollen/haben sollen, der dann für jeden die richtige config generiert (mit directory und library drin) und auch prüft ob das YAML valide ist

von node.js kenn ich gulp und grunt, sowas gibt es bestimmt für python/pip auch, muss ich mal suchen!

Schweinepriester commented 9 years ago

ich denke wir können das erstmal mit https://www.npmjs.com/package/gulp-replace ((github)[https://github.com/lazd/gulp-replace]) lösen, bspw. so:

directory: @directory@
library: @library@

die dann bei build durch die entsprechenden strings ersetzt werden

wäre auch interessant für andere einträge, z.B. den google_API_key für https://github.com/Schweinepriester/beets-config/issues/4#issuecomment-111614867

sicher gibt es solche tools auch für python/pip, konnte sie auf die schnelle gerade nicht finden, werde aber weitersuchen

Schweinepriester commented 9 years ago

meine idee bisher:

ordnerstruktur:

some_folder/          - Bspw. "E:\beets\"
  beets-config/       - Das repo, update- und commitbar
    config.yaml
    gulpfile.js
  output/             - Effektiv von beets verwendete config; BEETSDIR sollte hierhin zeigen
    config.yaml
  customconfig.yaml   - Eigene config, mit u.a. directory, library, google_API_key, etc.

durch das gulpfile gesteuert geht gulp hin und ersetzt in (einer kopie von) beet-confg/config.yaml alle strings mit dem pattern @string@ durch einträge aus customconfig.yaml und speichert die neue datei in output/ (alternative benennung: build?), als config.yaml, sodass diese datei sofort von beets dank BEETSDIR verwendet wird.

das laden von customconfig.yaml bspw. via https://github.com/jeremyfa/yaml.js und das ersetzen der strings bspw. via https://github.com/lazd/gulp-replace

dank gulp.watch, siehe hier ist es auch möglich für während der entwicklung automatisch bei jeder änderung eine neue datei zu erzeugen, sodass man es nicht jedes mal händisch machen muss

kommentar(e)?