diff options
Diffstat (limited to 'flask-mediabrowser')
-rwxr-xr-x | flask-mediabrowser | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/flask-mediabrowser b/flask-mediabrowser new file mode 100755 index 0000000..d1c0f8a --- /dev/null +++ b/flask-mediabrowser @@ -0,0 +1,27 @@ +#!/usr/bin/env python3.4 +from flask import Flask +from werkzeug.contrib.cache import SimpleCache + +import mediabrowser + +import os +import logging +from argparse import ArgumentParser + + +logging.basicConfig(level=logging.INFO) + + +if __name__ == "__main__": + parser = ArgumentParser(description="Flask Mediabrowser") + parser.add_argument("--root", metavar="DIR", required=True, + help="Media collection root directory") + + args = parser.parse_args() + + cache = SimpleCache(threshold=5000, default_timeout=60*60*5) + app = Flask("mediabrowser-demo") + app.register_blueprint(mediabrowser.build(args.root, cache)) + + app.run(debug=True) + |