Skip to content

Titleformat API

English API reference for the titleformat family.

This page is the primary owner for the namespaces listed below. Method names, parameter keys, and return fields follow the C++ RegisterApi handlers.

titleformat

titleformat.eval

Public API method. Runtime authority: src/api/TitleformatApi.cpp:401.

ParameterTypeRequiredDescription
pathstringNoOptional; default .
patternstringNoOptional; default .

Returns: {"error":"...","path":"...","pattern":"...","result":"...","success":true}

js
const result = await fb2k.invoke('titleformat.eval', { path: /* value */, pattern: /* value */ });

titleformat.evalBatch

Public API method. Runtime authority: src/api/TitleformatApi.cpp:402.

ParameterTypeRequiredDescription
pathsarrayYesRequired.
patternstringNoOptional; default .

Returns: {"error":"...","errorCount":"...","pattern":"...","results":"...","success":true,"successCount":"...","total":"..."}

js
const result = await fb2k.invoke('titleformat.evalBatch', { paths: /* value */, pattern: /* value */ });

titleformat.evalFields

Public API method. Runtime authority: src/api/TitleformatApi.cpp:403.

ParameterTypeRequiredDescription
fieldsobjectYesRequired.
pathstringNoOptional; default .

Returns: {"error":"...","path":"...","success":true}

js
const result = await fb2k.invoke('titleformat.evalFields', { fields: /* value */, path: /* value */ });

titleformat.evalFieldsBatch

Public API method. Runtime authority: src/api/TitleformatApi.cpp:404.

ParameterTypeRequiredDescription
fieldsobjectYesRequired.
pathsarrayYesRequired.

Returns: {"error":"...","errorCount":"...","results":"...","success":true,"successCount":"...","total":"..."}

js
const result = await fb2k.invoke('titleformat.evalFieldsBatch', { fields: /* value */, paths: /* value */ });

titleformat.getBuiltinFields

Public API method. Runtime authority: src/api/TitleformatApi.cpp:405.

No parameters.

Returns: {"fields":[],"success":true}

js
const result = await fb2k.invoke('titleformat.getBuiltinFields');

Evaluation semantics

  • titleformat.eval requires a non-empty path and pattern. Invalid patterns and unavailable files return success: false with error.
  • titleformat.evalBatch requires an array paths and a non-empty pattern; per-item failures are retained in results, while successCount and errorCount summarize the batch.
  • titleformat.evalFields and titleformat.evalFieldsBatch require an object fields. Each key becomes a response property; non-string field expressions are returned as null for that key.
  • titleformat.getBuiltinFields is a convenience reference generated by the runtime. It does not guarantee that optional component fields such as play-count data are populated for every installation or track.