-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add new directories to the config.json file #22
Comments
I really like the idea of fetching media from the web. |
And yes, the web interface should allow users to modify their directories, without having to modify a config file and restart the server. |
I've been experimenting and found this nice module, nconf, which is used in nodejitsu's flatiron framework. I'm going to build a config.ejs page that will use this as a demo. |
I've written a small, extensible script (lib/config.js) which creates an object with methods to add & remove tracks from the config.json using nconf & underscore.js. These two packages were used for simplicity and proof of concept and the same could be done without them. I think rather than a separate config.ejs view, the configuration of user options could be done in a settings widget/modal that uses the methods from the config.js object on any page of the application. |
One sub-issue with this method is that it doesn't mesh well with the way the application builds it's file list using the filemap. Adding a new path to the music_folders config.json option updates the file on the disk, but this change is not recognized until the app is restarted. |
Just add a method to the filemap to manipulate the underlying hash, file_dict. Everything is stored in memory at the moment, but we'll probably have a db backend as well at some point. |
@sr-ix , when the user modifies their config, send an ajax request, add a new route for updating the config, write the changes to file, and just call FileMap.update() to rescan the dirs from the config file. Then redraw the table listing. |
I think it would be helpful to use command line arguments or some other means to specify whether or not to use redis or default to a file. That way, a lone user doesn't need to install a db backend dependency, but we can and enable the app to run using redis with just a non default command line arg. eg: Single user:
Us:
|
It would be nice to be able to add new directories to the list of paths to search for media from the web.
In fact it would be nice to have some kind of interface to the config options in general.
The text was updated successfully, but these errors were encountered: