Class: LocationIndicator

@bldr/media-server~LocationIndicator

Indicate where a file is located in the media folder structure.

Merge the configurations entries of config.mediaServer.basePath and config.mediaServer.archivePaths. Store only the accessible ones.

new LocationIndicator ()

Members

main

paths_

Methods

get ()Array

Returns:
Type Description
Array
  • An array of directory paths in this order: First the main base path of the media server, then one ore more archive directory paths. The paths are checked for existence and resolved (untildified).

getBasePath (currentPath)String

Get the path relative to one of the base paths and currentPath.

Name Type Description
currentPath String

The path of a file or a directory inside a media server folder structure or inside its archive folders.

Returns:
Type Description
String

getMirroredPath (currentPath)String

Name Type Description
currentPath String

The path of a file or a directory inside a media server folder structure or inside its archive folders.

Returns:
Type Description
String

getPresParentDir (currentPath)String

Get the directory where a presentation file (Praesentation.baldr.yml) is located in (The first folder with a prefix like 10_)

/baldr/media/10/10_Jazz/30_Stile/20_Swing/Material/Duke-Ellington.jpg -> /baldr/media/10/10_Jazz/30_Stile/20_Swing

Name Type Description
currentPath String
Returns:
Type Description
String

getRelPath (currentPath)String

Get the path relative to one of the base paths and currentPath.

Name Type Description
currentPath String

The path of a file or a directory inside a media server folder structure or inside its archive folders.

Returns:
Type Description
String

isInArchive (currentPath)Boolean

Check if the currentPath is inside a archive folder structure and not in den main media folder.

Name Type Description
currentPath String
Returns:
Type Description
Boolean

isInDeactivatedDir ()

A deactivaed directory is a directory which has no direct counter part in the main media folder, which is not mirrored. It is a real archived folder in the archive folder. Activated folders have a prefix like 10_

true:

  • /archive/10/10_Jazz/30_Stile/10_New-Orleans-Dixieland/Material/Texte.tex
  • /archive/10/10_Jazz/History-of-Jazz/Inhalt.tex
  • /archive/12/20_Tradition/30_Volksmusik/Bartok/10_Tanzsuite/Gliederung.tex

false:

/archive/10/10_Jazz/20_Vorformen/10_Worksongs-Spirtuals/Arbeitsblatt.tex