Class: IntermediateLibrary

@bldr/songbook-intermediate-files~IntermediateLibrary

new IntermediateLibrary (basePath, projectorPath, pianoPath)

Name Type Description
basePath string

The base path of the song library

projectorPath string

Directory to store intermediate files for the projector app (*.svg, *.json).

pianoPath string

Directory to store intermediate files for the piano score (*.eps).

Members

A instance of the FileMonitor class.

pianoPath string

Directory to store intermediate files for the piano score (*.eps).

projectorPath string

Directory to store intermediate files for the projector app (*.svg, *.json).

songs object

Methods

cleanIntermediateFiles ()

Clean all intermediate media files.

collectSongs_ () private

deleteFiles_ (files) private

Delete multiple files.

Name Type Description
files array

An array of files to delete.

generateIntermediateFiles (mode, force)

Calls the method generateIntermediateFiles on each song

Name Type Default Description
mode string all

Generate all intermediate media files or only slide and piano files. Possible values: “all”, “slides” or “piano”

force boolean false

Force the regeneration of intermediate files.

gitPull ()

Execute git pull if repository exists.

update (mode, force)

Update the whole song library.

Name Type Default Description
mode string all

Generate all intermediate media files or only slide and piano files. Possible values: “all”, “slides” or “piano”

force boolean false

Force the regeneration of intermediate files.

updateSongByPath (folder, mode)

Generate all intermediate media files for one song.

Name Type Default Description
folder string

The path of the parent song folder.

mode string all

Generate all intermediate media files or only slide and piano files. Possible values: “all”, “slides” or “piano”

updateSongBySongId (songId, mode)

Generate all intermediate media files for one song.

Name Type Default Description
songId string

The ID of the song (the name of the parent song folder)

mode string all

Generate all intermediate media files or only slide and piano files. Possible values: “all”, “slides” or “piano”