#include <stdlib.h>
#include <stdio.h>

#include <uuid/uuid.h>

#include <string.h>

#include <gavl/gavl.h>
#include <gavl/metadata.h>
#include <gavl/utils.h>

#include <gmerlin/upnp/ssdp.h>
#include <gmerlin/http.h>
#include <gmerlin/utils.h>

#define APP_NAME "mediacenter"
#define ID_NAME "ClientID"
#define ID_LEN 36

int main(int argc, char ** argv)
  {
  char * command;

  char * server_url = NULL;
  
  if(argc > 1)
    server_url = argv[1];
  else
    {
    fprintf(stderr, "Usage %s <server_url>", argv[0]);
    return EXIT_FAILURE;
    }
  
  command = bg_sprintf("firefox -app %s/mediacenter/xul/application.ini \"%s\"",
                       DATA_DIR, server_url);
  
  fprintf(stderr, "Running command %s\n", command);
  
  if(system(command))
    return EXIT_FAILURE;
  else
    return EXIT_SUCCESS;
  }
