Class AlphaSync

Hierarchy

  • AlphaSync

Constructors

Properties

addr?: string = undefined
builder: XMLBuilder = ...
contentDirectory: undefined | ContentDirectory
date_to_items: Record<string, UPNPImage[]> = {}
discovery: Discovery
jobHasBeenCancelled: Boolean = false
parser: XMLParser = ...
port?: string = undefined
today: Date = ...

Accessors

Methods

  • Private

    Checks if an image already exists in a specified directory. If it does not, the image will be downloaded and saved.

    Parameters

    • item: UPNPImage | UPNPVideo

      The image or video to be checked.

    • files: Set<string>

      Set of existing file names in the directory.

    • savePath: string

      The path where the file would be saved.

    • key: string

      The key, typically a date string, used to identify the image or video in question.

    Returns Promise<void>

    Returns a promise that resolves when the check and potential download are complete.

    Throws

    Will throw an error if there's an issue in the image downloading process.

  • Returns Promise<void>

    Returns a promise that resolves when the discovery of services is finished.

    Async

    Discovers the available services on the Sony Alpha Camera.

    Throws

    Will throw an error if the discovery process fails or if the Content Directory service is not found.

  • Parameters

    • url: string

      The URL of the image to be downloaded.

    • savePath: string

      The path to save the downloaded image.

    Returns Promise<void>

    Returns a promise that resolves when the image is downloaded and saved.

    Async

    Downloads an image from a specific URL.

    Throws

    Will throw an error if the image downloading process fails.

  • Returns Promise<void>

    Returns a promise that resolves when the tree generation is finished.

    Async

    Generates the Content Directory tree of the Sony Alpha Camera.

    Throws

    Will throw an error if the Content Directory service is not found or discovered yet.

  • Parameters

    • savePath: string

      The path where the fetched images will be saved.

    • afterDate: string[]

      The start date for fetching images, in the format ['YYYY', 'MM', 'DD'].

    • beforeDate: string[]

      The end date for fetching images, in the format ['YYYY', 'MM', 'DD'].

    Returns Promise<void>

    Returns a promise that resolves when all images between the specified dates are fetched and saved.

    Async

    Fetches all images taken between two specific dates.

    Throws

    Will throw an error if the dates are not in the correct format, or if there's an error in the image downloading process.

  • Parameters

    • container: UPNPContainer

      The container to fetch images from.

    • savePath: string

      The path to save the fetched images.

    Returns Promise<void>

    Returns a promise that resolves when all images are fetched and saved.

    Async

    Fetches all images from a specific container in the Content Directory service.

    Throws

    Will throw an error if the image fetching process fails.

  • Parameters

    • savePath: string

      The path where the fetched images will be saved.

    • Optional dict: Record<string, UPNPImage[]>

      An optional dictionary parameter where each key (date string) maps to an array of UPNPImage objects. If not provided, the function will use the date_to_items property of the class.

    Returns Promise<boolean>

    Returns a promise that resolves when all images from the dictionary are fetched and saved. True when job is finished, false when it is interrupted

    Async

    Fetches all images from a provided dictionary, where each date maps to multiple images.

    Throws

    Will throw an error if there are no entries with specific keys in the record or if there's an error in the image downloading process.

  • Parameters

    • date: string

      The date to fetch images from.

    • savePath: string

      The path to save the fetched images.

    Returns Promise<void>

    A promise that resolves when all images are fetched and saved.

    Async

    Fetches all images from a specific date in the Content Directory service.

    Throws

    If the image fetching process fails.

  • Parameters

    • savePath: string

      The path to save the fetched images.

    Returns Promise<void>

    Returns a promise that resolves when all images are fetched and saved.

    Async

    Fetches all images as per the Content Directory tree.

    Throws

    Will throw an error if the tree is not created yet. Run the generate_tree method before calling this method.

  • Private

    Returns a Set of filenames of all existing images for a specific date in a given path.

    Parameters

    • key: string

      Date for which images are checked.

    • savePath: string

      Path where images are saved.

    Returns Set<string>

    Returns a set of filenames of existing images for the date specified.

  • Parameters

    • savePath: string

      The path to save the fetched image.

    Returns Promise<void>

    Returns a promise that resolves when the image is fetched and saved.

    Async

    Fetches a single image from the Digital Imaging service.

    Throws

    Will throw an error if the Digital Imaging service is not discovered yet or if the image fetching process fails.

  • Returns Promise<void>

    Returns a promise that resolves when the SSDP process is finished.

    Async

    Initiates the SSDP (Simple Service Discovery Protocol) process for service discovery.

    Throws

    Will throw an error if the SSDP process fails.

Generated using TypeDoc