Global

Members

(constant) ansiStripFormat

Formatter for winston which strips out any ansi formatting from the message. Logs should NEVER have ANSI colors when not being run interactively.

Source:

(constant) CORNER_OFFSET

How many pixels a label MUST be off the edge of the screen. this class guarantees it never goes beyond this limit.

Source:

(constant) ESSENTIAL_FIELDS

The fields that can NEVER be disabled.

If you could remove every field from the dashboard, then what is the dashboard even showing?

Source:

(constant) NetworkIndicatorStats

Represents a single displayable metric for transmissions network communications.

This couldb be the transfer rate, download limit, total downloaded bytes, etc. A negative value implies there is no limit (or the value is so high its overflowed), in which case an infinity symbol is shown.

Source:

NotificationTypes

The kinds of notifications that puddle can share with the user.

Source:

OverlayType

The kinds of overlays that can be shown. each of these should have an associated store, but they don't HAVE to have one.

Source:

(constant) PRIORITY_CLASSES

class names for each priority type in the known types. Theses are used to influence the styling of the element.

Source:

(constant) PRIORITY_LABELS

The labels shown alongside each priority level when allowed.

Source:

(constant) puddleShrinkLevelFormat

Formatter for winston which trims and colorizes common levels to a single character.

Source:

(constant) QUERY_SET_TIMEOUT

How long a search should be idle before we automatically start searching. The shorter it is, the more bogus searches will take place. The longer it is, the less intuitive the search feels.

Source:

(constant) selectFilteredTorrents

Returns the ids of the subset of torrents in the torrent list which the filters will accept IN LINEAR TIME.

This is a heavily optomised selector for filtering through the active torrents list. It works based on caching the list of torrents matching each individual filter (each of which is only rebuilt when their associated filter properties are modified) and then simply for membership in all of the possible filter predicated.

Source:

(constant) selectTorrentsMatchingClassPredicate

Construct and return a predicate which given some torrent id will return whether the class of the associated torrent matches the active torrent class in puddles filter.

Source:

(constant) selectTorrentsMatchingLabelsPredicate

Like {@code selectTorrentsMatchingTrackersPredicate} but targets torrent labels instead of torrent trackers.

Source:

(constant) selectTorrentsMatchingQueryPredicate

Construct and return a predicate which will, given some torrent id, will return whether that torrents name matches the query.

Source:

(constant) selectTorrentsMatchingTrackersPredicate

Construct and return a predicate which, given some torrent id returns whether the associated torrent has a tracker in the active trackers filter. If the filter is empty then every torrent passes the filter.

Source:

(constant) selectTorrentsSearchIndex

Construct and return a flexsearch search index for the current list of torrent names. Using {@code createSelector} here means that this index will only be reconstructed when a torrents name changes... which is very unlikely, so for the vast majority of puddles runtime, it'll be cached.

tldr; MAJOR MEMORY AND RUNTIME BENEFITS.

Source:

(constant) serverPromise

Used to block the binding of the server until after this promise is resolved. Until top level await is ubiquotous this'll have to do.

Source:

(constant) StartStopButtons

Component hoisting two buttons to indicate whether the current torrent is paused or running and lets you click on it to toggle these possible states.

Source:

(constant) syncTorrents

Remove all elements from the store and then fetch the current torrent-list from transmission and assign it.

Source:

(constant) TORRENT_BASE

A base type to supply defaults for the fields in {@code Torrent} that aren't in {@code TorrentDefaultFields}.

Source:

(constant) torrentComparators

Used for sorting torrents on the dashboard.

Each of these should be a function that compares two torrent instances and returns either +ve, -ve or 0 to indicate precedence based on the given field. For more information see [[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort][Array.prototype.sort]].

Source:

TorrentFields

The complete set of fields the user can be shown on the dashboard. A subset of these will commonly be presented and the user retains.

Source:

(constant) torrentRangeSelected

Select torrents in a range, using {@code anchor} to determine where the selection should stop. The behaviour here is similair to shift clicking a range of files in a conventional file manager.

The selection algorithm has the following rules.

  • With only one existing selection all torrents in the range including the anchor and the selection will be selected. NOTE if there's no selection, an invisible selection will be placed on the first torrent.

    | | | | | Selected | | Selected | | | ===> | Selected | | Anchor | | Selected | | | | |

  • When multiple selections already exist and the anchor lies outside of the range between the highest selection and lowest selection, all torrents in the range between the existing selection and the anchor will be selected.

    | | | | | Selected | | Selected | | | | Selected | | Selected | ===> | Selected | | | | Selected | | Anchor | | Selected | | | | |


    | | | | | Anchor | | Selected | | | | Selected | | | ===> | Selected | | Selected | | Selected | | Selected | | Selected | | | | |

  • When multiple selections exist and the anchor lies between the range of the highest and lowest selection. All files in the range between the highest and lowest selection will be selected.


    | | | | | Selected | | Selected | | | | Selected | | Anchor | ===> | Selected | | | | Selected | | Selected | | Selected | | | | |

Source:

(constant) torrentsAdded

action for when one or more new torrents have been added.

Source:

(constant) torrentSelected

action for selecting one or more torrents from the torrent list.

Source:

(constant) torrentsRemoved

action for when one or more torrents have been removed.

Source:

(constant) torrentsUpdated

action for when we're updating one or more torrents.

Source:

(constant) updateRecentlyActiveTorrents

Asynchronously fetch the current torrent list from the transmission daemon and then update the local store.

Source:

Methods

authenticate()

check whether the given transmission URL is a valid transmission instance.

Source:

authenticated()

Check whether the current user has an associated transmission connection.

Source:

constructFileTree()

Convert a list of file paths with an associated identifier into a tree like structure (centered around javascript objects).

Source:

cyclePriority()

Cycle a priority type to the next priority type.

Source:

dirNames(path, seperator)

Return a string consisting of all parent directories of path.

Source:
Parameters:
Name Type Description
path

the path for which we're extracting dirnames.

seperator

= "/", the path seperator.

Example
dirNames('foo/bar/baz/bag/bar') // => ['foo/bar/baz/bag', 'foo/bar/baz', 'foo/bar', 'foo']

fromSerialised()

Construct a new transmission instance from a serialised property struct.

Source:

isPriorityType()

Assert whether {@code p} is an extended priority type, or a regular one.

Source:

notificationIdGen()

Generate a psuedo unique identifier for a new notification.

Psuedo unique because there's no guarantee it will be unique, but the chance of it being a duplicate should be extremely low.

Source:

onSubmitGeneral()

Generic on-submit handler for adding a torrent to transmission through the torrent-add modal.

Source:

prepareFiles()

Prepare a file collection to be converted to a file tree. This just sorts the files and then merges them with their indexes in the original file array.

Source:

reduceMapping(collection, active,)

Convert a mapping from some index type to torrent ids, into a set of unique ids filtered by membership in {@code active}.

Source:
Parameters:
Name Type Description
collection

of some arbitrary identifier to torrent ids

active,

subset of keys in collection

Returns:

the flattened unique set of torrent ids retrieved by mapping each key in {@code active} through {@code collection}.

setDifference()

Return the set of all elements in a that are not in b.

Source:

setPartition()

Find the set partition of two collections of the same type.

A set partition is the list of elements that have been removed from the first collection and the list of elements added to the first collection.

Source:
Returns:

[removed, added] a tuple of the change in state.

torrentClass()

Given a torrent, return a number indicating the subset of supported torrent classes the torrent has.

Source:

torrentClasses()

assign the classes for a torrent row.

Source:

torrentFromResponse()

Convert an API response that's guaranteed to have the fields in {@code TORRENT_FIELDS} to a Torrent instance.

Source:

torrentIdsToParam(ids)

Converts an {@code TorrentIds} argument to an object with the associated fields for a request. This really only exists to make stripping out the ids field when {@code ids} is undefined more straightforward.

Source:
Parameters:
Name Type Description
ids

that are going to be passed in the request.

Returns:

an empty params object containing just the intended recipients for the current request.

torrentSelector()

Utility selector for extracting the torrent instance associated with this overlay and then passing through {@code selector} to extract a torrent field.

Source:

treeTraverse(tree, path)

expand a full path in a file-tree, returning the entry associated with the path.

Source:
Parameters:
Name Type Description
tree

the tree to be traversed

path

the path of an entry at aribtrary depth in tree.

URLInput()

Form component to show a list of input fields, with the ability to add or remove new fields.

Source:

validateForm()

Assert whether form data is all valid.

Source: