playlite
    Preparing search index...

    Variable librariesServiceConst

    librariesService: {
        initDb: () => Promise<void>;
        getGames: () => Promise<Game[]>;
        addGame: (
            game: {
                id: string;
                name: string;
                platform: string;
                coverUrl: string | null;
                playtime: number;
                userRating: number | null;
                status:
                    | "playing"
                    | "completed"
                    | "backlog"
                    | "abandoned"
                    | "plan_to_play";
                installPath: string
                | null;
                executablePath: string | null;
                launchArgs: string | null;
            },
        ) => Promise<void>;
        updateGame: (
            game: {
                id: string;
                name: string;
                platform: string;
                coverUrl: string | null;
                playtime: number;
                userRating: number | null;
                status:
                    | "playing"
                    | "completed"
                    | "backlog"
                    | "abandoned"
                    | "plan_to_play";
                installPath: string
                | null;
                executablePath: string | null;
                launchArgs: string | null;
            },
        ) => Promise<void>;
        deleteGame: (id: string) => Promise<void>;
        toggleFavorite: (id: string) => Promise<void>;
    } = ...

    Type Declaration

    • initDb: () => Promise<void>

      Inicializa o banco de dados local (SQLite) se ainda não existir

    • getGames: () => Promise<Game[]>

      Busca todos os jogos da biblioteca local (SQLite)

    • addGame: (
          game: {
              id: string;
              name: string;
              platform: string;
              coverUrl: string | null;
              playtime: number;
              userRating: number | null;
              status: "playing" | "completed" | "backlog" | "abandoned" | "plan_to_play";
              installPath: string | null;
              executablePath: string | null;
              launchArgs: string | null;
          },
      ) => Promise<void>

      Adiciona novo jogo à biblioteca local (SQLite). Se já existir jogo com mesmo ID, sobrescreve completamente os dados.

    • updateGame: (
          game: {
              id: string;
              name: string;
              platform: string;
              coverUrl: string | null;
              playtime: number;
              userRating: number | null;
              status: "playing" | "completed" | "backlog" | "abandoned" | "plan_to_play";
              installPath: string | null;
              executablePath: string | null;
              launchArgs: string | null;
          },
      ) => Promise<void>

      Atualiza dados de um jogo existente na biblioteca. Não faz nada se o ID não existir (operação silenciosa).

    • deleteGame: (id: string) => Promise<void>

      Remove jogo da biblioteca local pelo ID

    • toggleFavorite: (id: string) => Promise<void>

      Alterna o status de favorito de um jogo na biblioteca local