Repositories

Get list of repositories

getRepos Operator user required Frontend can be closed, restricted or open

Get list of repositories

Note : if the user requesting this is not admin, you'll only get a small subset of each repository, namely Name, Online and Enabled settings. All other settings are admin-only.

Response
[
    {
        Name: "kara.moe",
        Online: true,
        Enabled: true,
        SendStats: true,
        BaseDir: "app/data",
        AutoMediaDownloads: true,
        MaintainerMode: true,
        Git: {
            URL:           // Git URL for the repository
            Username:      // Git username
            Password:      // Git password
            Author:        // Git identity
            Email:         // Git email
            ProjectID?:    // Gitlab project ID
        };
        FTP: {
            Port:          // FTP port
            Host:          // FTP Host to put medias into
            Username:      // FTP username
            Password:      // FTP Password
            BaseDir:       // Directory inside the FTP where to upload files
        },
        Path: {
            Medias: ["app/data/medias"]
        }
    },
    ...
]
Response
{
    code: 500,
    message: {
        code: 'REPO_LIST_ERROR'
    }
}

Add a repository

addRepo Operator user required Frontend can be closed, restricted or open

Add a new repository

Request
{
    Name: 'world.karaokes.moe',
    Online: true // Is it an online repository?
    Enabled: true
    SendStats: true
    Path: {
        Karas: string[]
        Lyrics: string[]
        Medias: string[]
        Tags: string[]
    }
}
Response
{
    code: 200,
    message: {
        code: 'REPO_CREATED'
    }
}
Response
{
    code: 500,
    message: {
        code: 'REPO_CREATE_ERROR'
    }
}

Get a single repository

getRepo Operator user required Frontend can be closed, restricted or open

Get a single repository

Request
{
    name: 'kara.moe'
}
Response
{
        "Name": "kara.moe",
        "Online": true
        "Enabled": true
        "SendStats": true
        "Path": {
            "Karas": ["app/data/karaokes"]
            "Lyrics": ["app/data/lyrics"]
            "Tags": ["app/data/tags"]
            "Medias": ["app/data/medias"]
        }
},
Response
{
    code: 500,
    message: {
        code: 'REPO_GET_ERROR'
    }
}

Remove repository

deleteRepo Operator user required Frontend can be closed, restricted or open

Remove a repository from Karaoke Mugen

Request
{
    name: 'kara.moe'
}
Response
{
    code: 200,
    message: {
        code: 'REPO_DELETED'
    }
}
Response
{
    code: 500,
    message: {
        code: 'REPO_DELETE_ERROR'
    }
}

Edit a repository

editRepo Operator user required Frontend can be closed, restricted or open

Edit a repository

Request
{
  name: 'kara.moe'
  newRepo: {
      Name: 'new.kara.moe'
      <See repo object in getRepos>
  }
}
Response
{
  code: 200,
  message: {
      code: 'REPO_EDITED'
  }
}
Response
{
    code: 500,
    message: {
        code: 'REPO_EDIT_ERROR'
    }
}
Response
{
    code: 404
}

View all unused tags

getUnusedTags Operator user required Frontend can be closed, restricted or open

Get a list of all tags unused in a repository.

Request
{
  name: 'kara.moe'
}

Response is made of an array of Tag objects

Response
{
    code: 500,
    message: {
        code: 'REPO_GET_UNUSEDTAGS_ERROR'
    }
}

View all unused medias

getUnusedMedias Operator user required Frontend can be closed, restricted or open

View all unused medias from a repository. Unused medias aren't used by any karaoke.

Since this takes time, this creates a new Task.

Request
{
  name: 'kara.moe'
}
Response
[
    "/path/to/unused media 1.mp4"
    "/path/to/unused media 2.mp4"
]
Response
{
    code: 500,
    message: {
        code: 'REPO_GET_UNUSEDMEDIA_ERROR'
    }
}

Consolidate repository

consolidateRepository Operator user required Frontend can be closed, restricted or open

This moves all folders from a repository into the same base folder.

Example if you have a repository with:

  • Medias: /path/to/videos
  • Karaokes: /MyGit/karaokes
  • Lyrics: /MyGit/lyrics
  • Tags: /MyGit/tags

If you consolidate it to /MyGit/ the videos folder will be moved to /MyGit/

Request
{
  name: 'kara.moe',
  path: '/MyGit/'
}

Consolidation is started and you get an immediate response. It starts a Task so you can check its progress.

Response
{
    code: 200,
    message: {
        code: 'REPO_CONSOLIDATING_IN_PROGRESS'
    }
}

Compare lyrics between repositories

compareLyricsBetweenRepos Operator user required Frontend can be closed, restricted or open

Get a report of lyrics that differ between two repositories. It is useful when you have two repositories with the same songs in them and wish to make sure lyrics you modified on the first repository are copied to the second one.

Request
{
  repo1: 'kara.moe',
  repo2: 'world.karaokes.moe'
}
Response
[
    {
        kara1: <See Kara object>,
        kara2: <See Kara object>
    },
    ...
]
Response
{
    code: 500,
    message: {
        code: 'REPO_COMPARE_LYRICS_ERROR'
    }
}

Copy lyrics from a repository to another

copyLyricsBetweenRepos Operator user required Frontend can be closed, restricted or open

Copies lyrics from one repository to another.

You feed this command the exact same results you got from Compare lyrics between repositories

Request
[
    {
        kara1: <See Kara object>,
        kara2: <See Kara object>
    },
    ...
]

{ code: 200, message: { code: 'REPO_LYRICS_COPIED' } }

Response
{
    code: 500,
    message: {
        code: 'REPO_COPY_LYRICS_ERROR'
    }
}

Delete all medias from repository

deleteAllRepoMedias Operator user required Frontend can be closed, restricted or open

Delete all medias from a specific repository (to free up space)

Request
{
    name: 'kara.moe'
}
Response
{
    code: 200,
    message: {
        code: 'REPO_ALL_MEDIAS_DELETED'
    }
}
Response
{
    code: 500,
    message: {
        code: 'REPO_DELETE_ALL_MEDIAS_ERROR'
    }
}

Delete old medias from repository

deleteAllRepoMedias Operator user required Frontend can be closed, restricted or open

Delete old (played more than one month ago) medias from a specific repository (to free up space)

Request
{
    name: 'kara.moe'
}
Response
{
    code: 200,
    message: {
        code: 'REPO_OLD_MEDIAS_DELETED'
    }
}
Response
{
    code: 500,
    message: {
        code: 'REPO_DELETE_OLD_MEDIAS_ERROR'
    }
}

Delete Medias

deleteMedias Operator user required Frontend can be closed, restricted or open

Remove medias by selecting specific songs

Request
{
    kids: ['abc', 'def']    
}
Response
{
    code: 200,
    message: {
        code: 'REPO_MEDIAS_DELETED'
    }
}
Response
{
    code: 500,
    message: {
        code: 'REPO_DELETE_MEDIAS_ERROR'
    }
}

Update all repositories

updateAllRepositories Operator user required Frontend can be closed, restricted or open

Launches an update of all enabled and online repositories

The update is launched asynchronously so it returns immediately.

Update repository (via Git)

updateAllRepositories Operator user required Frontend can be closed, restricted or open

Updates a repository using Git (maintainer mode only)

Request
{
    repoName: 'kara.moe'
}
Response
{
    code: 500,
    message: {
        code: 'REPO_GIT_UPDATE_ERROR'
    }
}

Stash repository modifications (via Git)

stashRepo Operator user required Frontend can be closed, restricted or open

Stashes any modifications (via git) in a re pository

Request
{
    repoName: 'kara.moe'
}
Response
{
    code: 500,
    message: {
        code: 'REPO_GIT_STASH_ERROR'
    }
}

Check repository status (via Git)

checkRepo Operator user required Frontend can be closed, restricted or open

Check repository status (clean or not clean).

Clean means no modifications are present adn the repository is updatable.

Response
{
    code: 500,
    message: {
        code: 'REPO_GIT_CHECK_ERROR'
    }
}

List repository stashes (via Git)

listRepoStashes Operator user required Frontend can be closed, restricted or open

Returns a list of repo stashes so that you can choose to pop or drop them

Request
{
    repoName: 'kara.moe'
}
Response
{
    code: 500,
    message: {
        code: 'REPO_GIT_CHECK_ERROR'
    }
}

Pop repository stash (via Git)

popStash Operator user required Frontend can be closed, restricted or open

Pops an existing stash into the repository working directory

Request
{
    repoName: 'kara.moe',
    stashId: 2
}
Response
{
    code: 500,
    message: {
        code: 'REPO_GIT_UNSTASH_ERROR'
    }
}

Drop repository stash (via Git)

dropStash Operator user required Frontend can be closed, restricted or open

Removes a stash from the git repository without popping it.

Request
{
    repoName: 'kara.moe',
    stashId: 2
}
Response
{
    code: 500,
    message: {
        code: 'REPO_GIT_UNSTASH_ERROR'
    }
}

Reset repository (via Git)

resetRepo Operator user required Frontend can be closed, restricted or open

Performs a `git reset --hard origin/master` on a repository to reset it to its initial state.

Request
{
    repoName: 'kara.moe'    
}
Response
{
    code: 500,
    message: {
        code: 'REPO_GIT_RESET_ERROR'
    }
}

Generate commits to push (via Git)

getCommits Operator user required Frontend can be closed, restricted or open

Generates a list of commits depending on which files are present in the working directory. The generated list allows you to check which commits are going to be made, modify them (message for example), and then submit them to the `pushCommits` route (see below)

Note: this does not create the commits in the git index, but rather generates a list of files to include in each commit. The real action is done by the pushCommits route.

Request
{
    repoName: 'kara.moe'    
}
Response
{
    code: 500,
    message: {
        code: 'REPO_GIT_GET_COMMITS_ERROR'
    }
}

Push commits and media (via Git)

pushCommits Operator user required Frontend can be closed, restricted or open

Pushes media via FTP, creates the commits in git and then pushes them, in that order.

Request
{
    commits: {
        commits: [
            {
                addedFiles: ['karaokes/JPN - blabla - OP - truc.kara.json', 'lyrics/JPN - blabla - OP - truc.ass'],
                modifiedFiles: [],
                deletedFiles: [],
                message: 'Add kara'
            }
        ],
        modifiedMedias: [
            {
                old: null,
                new: 'JPN - blabla - OP - truc.mp4',
                commit: 'Add kara'
            }        
        ]
    },
    repoName: 'kara.moe',
    ignoreFTP: false //Ignores FTP actions if any should be done.
}
Response
{
    code: 500,
    message: {
        code: 'REPO_GIT_PUSH_ERROR'
    }
}

Force upload media to FTP

uploadMedia Operator user required Frontend can be closed, restricted or open

Forces the upload of a song's particular media to the FTP

Request
{
    kid: 'abcdefghj'
}
Response
{
    code: 500,
    message: {
        code: 'REPO_UPLOAD_MEDIA_ERROR'
    }
}

Sync tags between two repositories

syncTagsBetweenRepos Operator user required Frontend can be closed, restricted or open

Forces tags in `repoDestName` to be updated with their counterparts in `repoSourceName`

Request
{
    repoSourceName: kara.moe,
    repoDestName: Local
}
Response
{
    code: 500,
    message: {
        code: 'REPO_SYNC_TAGS_ERROR'
    }
}