import lib
from server.variables import ServerVariables
from flask import Flask

app = Flask(__name__)
library = lib.get_instance()  # Get the music library
variables = ServerVariables()  # Import server variables instance

# Has to be imported after declaring variables 'app', 'library' and 'variables'
import server.routes


def start_server():
    app.debug = False
    app.run(host="0.0.0.0", port=80, threaded=True)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import lib
from mutagen.easyid3 import EasyID3
from mutagen.mp3 import MP3

if not os.geteuid() == 0:
    sys.exit("Only root can run this script")

library = lib.get_instance()


def fix():
    print "What do you want to edit?"
    print "1. Artist name"
    print "2. Album name"
    print "3. Song name"

    ans = input("Which of the following do you want to edit? ")

    if ans == 1:
        nr_files = 0
        j = 0
        print "The following artists have been found:"
        for j, artist in enumerate(
                sorted(library.get_artists(), key=lambda a: a.get_name())):
            print str(j) + ". " + artist.get_name()
        print str(j + 1) + ". None, go back"
        i = input("Which of the following artists do you want to rename? ")