Module: misc

Methods


<static> AssocArrayEqual(Array1, Array2)

Parameters:
Name Type Description
Array1 object
Array2 object
Source:
Returns:
Type
boolean

<static> arrayHasValue(arr, value)

Check if a specific value is inside of an array

Parameters:
Name Type Description
arr object
value dynamic
Source:
Returns:
Type
boolean

<static> div_ceiling(a, b)

Parameters:
Name Type Description
a integer
b integer
Source:
Returns:
Type
integer

<static> findNodeBySubtype(node, subtype)

Parameters:
Name Type Description
node dynamic
subtype dynamic
Source:
Returns:
Type
dynamic

<static> formatTime(time)

Format time as 12 or 24 hour format based on system clock setting

Parameters:
Name Type Description
time dynamic
Source:
Returns:
Type
string

<static> getButton(msg [, subnode])

Parameters:
Name Type Argument Default Description
msg dynamic
subnode string <optional>
"buttons"
Source:
Returns:
Type
object

<static> getMinutes(ticks)

Converts ticks to minutes

Parameters:
Name Type Description
ticks dynamic
Source:
Returns:
Type
integer

<static> getMsgPicker(msg [, subnode])

Parameters:
Name Type Argument Default Description
msg dynamic
subnode string <optional>
""
Source:
Returns:
Type
object

<static> get_dialog_result(dialog, port)

Returns the item selected or -1 on backpress or other unhandled closure of dialog.

Parameters:
Name Type Description
dialog dynamic
port dynamic
Source:
Returns:
Type
dynamic

<static> inArray(haystack, needle)

Search string array for search value. Return if it's found

Parameters:
Name Type Description
haystack dynamic
needle dynamic
Source:
Returns:
Type
boolean

<static> isLocalhost(url)

Returns true if the string is a loopback, such as 'localhost' or '127.0.0.1'

Parameters:
Name Type Description
url string
Source:
Returns:
Type
boolean

<static> isNodeEvent(msg, field)

Parameters:
Name Type Description
msg dynamic
field string
Source:
Returns:
Type
boolean

<static> isValid(input)

Returns whether or not passed value is valid

Parameters:
Name Type Description
input dynamic
Source:
Returns:
Type
boolean

<static> isValidAndNotEmpty(input)

Returns whether or not passed value is valid and not empty
Accepts a string, or any countable type (arrays and lists)

Parameters:
Name Type Description
input dynamic
Source:
Returns:
Type
boolean

<static> lastFocusedChild(obj)

Parameters:
Name Type Description
obj object
Source:
Returns:
Type
object

<static> leftPad(base, fill, length)

Parameters:
Name Type Description
base string
fill string
length integer
Source:
Returns:
Type
string

<static> message_dialog( [message])

Parameters:
Name Type Argument Default Description
message string <optional>
""
Source:
Returns:
Type
dynamic

<static> option_dialog(options [, message] [, defaultSelection])

Parameters:
Name Type Argument Default Description
options dynamic
message dynamic <optional>
""
defaultSelection dynamic <optional>
0
Source:
Returns:
Type
integer

<static> parseUrl(url)

Returns an array from a url - [ url, proto, host, port, subdir/params ]
If port or subdir are not found, an empty string will be added to the array
Proto must be declared or array will be empty

Parameters:
Name Type Description
url string
Source:
Returns:
Type
object

<static> roundNumber(f)

Rounds number to nearest integer

Parameters:
Name Type Description
f float
Source:
Returns:
Type
integer

<static> secondsToHuman(totalSeconds)

Parameters:
Name Type Description
totalSeconds integer
Source:
Returns:
Type
string

<static> setFieldTextValue(field, value)

Parameters:
Name Type Description
field dynamic
value dynamic
Source:
Returns:
Type
void

<static> show_dialog(message [, options] [, defaultSelection])

Parameters:
Name Type Argument Default Description
message string
options dynamic <optional>
[]
defaultSelection dynamic <optional>
0
Source:
Returns:
Type
integer

<static> standardize_jellyfin_url(url)

Take a jellyfin hostname and ensure it's a full url.
prepend http or https and append default ports, and remove excess slashes

Parameters:
Name Type Description
url string
Source:
Returns:
Type
dynamic

<static> startLoadingSpinner()

Source:
Returns:
Type
void

<static> startMediaLoadingSpinner()

Source:
Returns:
Type
void

<static> stopLoadingSpinner()

Source:
Returns:
Type
void

<static> ticksToHuman(ticks)

Parameters:
Name Type Description
ticks longinteger
Source:
Returns:
Type
string

<static> toString(input)

Parameters:
Name Type Description
input dynamic
Source:
Returns:
Type
string

<static> versionChecker(versionToCheck, minVersionAccepted)

Returns whether or not a version number (e.g. 10.7.7) is greater or equal
to some minimum version allowed (e.g. 10.8.0)

Parameters:
Name Type Description
versionToCheck string
minVersionAccepted string
Source:
Returns:
Type
dynamic