syntax = "proto3";

package retrom;

message ConnectionConfig {
  optional int32 port = 1;
  optional string db_url = 2;
}

message IgnorePatterns {
  repeated string patterns = 1;
}

enum StorageType {
  // Standard library directory with single-file games
  // e.g. /contentDir/platformX/game.rom
  SINGLE_FILE_GAME = 0;

  // Standard library directory with multi-file games
  // e.g. /contentDir/platformX/game/game.rom
  MULTI_FILE_GAME = 1;

  // Custom, user-defined structure composed of named macros
  // used for non-standard library directories and/or automatic
  // tagging of scanned entries
  //
  // example user definition: "/some/path/{platform}/{game}/{region}/{file}"
  CUSTOM = 2;
}

message CustomLibraryDefinition {
  string definition = 1;
}

message ContentDirectory {
  string path = 1;
  optional StorageType storage_type = 2;
  optional IgnorePatterns ignore_patterns = 3;
  optional CustomLibraryDefinition custom_library_definition = 4;
}

message IGDBConfig {
  string client_id = 1;
  string client_secret = 2;
}

message SteamConfig {
  string api_key = 1;
  string user_id = 2;
}

message SavesConfig {
  int32 max_save_files_backups = 1;
  int32 max_save_states_backups = 2;
}

message ServerConfig {
  message TelemetryConfig {
    bool enabled = 1;
  }

  ConnectionConfig connection = 1;
  repeated ContentDirectory content_directories = 2;
  optional IGDBConfig igdb = 3;
  optional SteamConfig steam = 4;
  optional SavesConfig saves = 5;
  optional TelemetryConfig telemetry = 6;
}
