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

Add new directories to the config.json file #22

Open
sr-ix opened this issue Nov 22, 2012 · 8 comments
Open

Add new directories to the config.json file #22

sr-ix opened this issue Nov 22, 2012 · 8 comments

Comments

@sr-ix
Copy link

sr-ix commented Nov 22, 2012

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.

@nickdesaulniers
Copy link
Owner

I really like the idea of fetching media from the web.
Find one that's hosted elsewhere using something like this and be able to stream it from them, transcoding if needed. ;)

@nickdesaulniers
Copy link
Owner

And yes, the web interface should allow users to modify their directories, without having to modify a config file and restart the server.

@sr-ix
Copy link
Author

sr-ix commented Nov 22, 2012

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.

@sr-ix
Copy link
Author

sr-ix commented Nov 23, 2012

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.

@sr-ix
Copy link
Author

sr-ix commented Nov 23, 2012

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.

@nickdesaulniers
Copy link
Owner

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.

@nickdesaulniers
Copy link
Owner

@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.

@nickdesaulniers
Copy link
Owner

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:

$ audiostream start

Us:

$ audiostream start -redis connection@string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants