'Import a PlexWatch or Plexivity database into PlexPy.
Required parameters:
app (str):                      "plexwatch" or "plexivity"
database_path (str):            The full path to the plexwatch database file
table_name (str):               "processed" or "grouped"
Optional parameters:
import_ignore_interval (int):   The minimum number of seconds for a stream to import
Returns:
None'

@cherrypy.expose
@requireAuth(member_of('admin'))
@addtoapi()
def import_database(self, app=None, database_path=None, table_name=None, import_ignore_interval=0, **kwargs):

    if (not app):
        return 'No    app    specified    for    import'
    if (app.lower() == 'plexwatch'):
        db_check_msg = plexwatch_import.validate_database(database=database_path, table_name=table_name)
        if (db_check_msg == 'success'):
            threading.Thread(target=plexwatch_import.import_from_plexwatch, kwargs={'database': database_path, 'table_name': table_name, 'import_ignore_interval': import_ignore_interval}).start()
            return 'Import    has    started.    Check    the    PlexPy    logs    to    monitor    any    problems.'
        else:
            return db_check_msg
    elif (app.lower() == 'plexivity'):
        db_check_msg = plexivity_import.validate_database(database=database_path, table_name=table_name)
        if (db_check_msg == 'success'):
            threading.Thread(target=plexivity_import.import_from_plexivity, kwargs={'database': database_path, 'table_name': table_name, 'import_ignore_interval': import_ignore_interval}).start()
            return 'Import    has    started.    Check    the    PlexPy    logs    to    monitor    any    problems.'
        else:
            return db_check_msg
    else:
        return 'App    not    recognized    for    import'
