Device class representing media sync profile

Device

Hierarchy (view full)

Constructors

Properties

Methods

Events

Constructors

Properties

allowWifiSync: boolean

Indicates whether remote sync is granted for this device sync profile

asJSON: string

Gets the object as serialized JSON string. Or sets serialized JSON (to fill this object's metadata by the metadata included within the JSON)

autoConvertConfig: AutoConvertSettings

Auto-convert rules config

autoUnmount: boolean

Undocumented

biDirConfirm: boolean

Indicates whether files to be copied from the device to the PC needs user confirmation during sync

biDirSync: boolean

Indicates whether content should by synced bidirectionally, i.e. also from the device to the PC

biDirSyncMetadata: boolean

Indicates whether file metadata changes should be synced from the device to the PC

calculator: DeviceCalculator

Undocumented

connected: boolean

Indicates whether this device is USB connected

convertArtwork: boolean

Whether artwork should be converted

convertArtworkType: string

Type to which the artwork should be converted

copyToPCFolder: string

Local folder representing where should be copied files from the device

customJSON: string

Optional, sync handlers stores custom service data here

deleteConfirm: boolean

Indicates whether files deletion should be confirmed by user during auto sync

deleteConfirmUnknown: boolean

Undocumented

deleteUnknown: boolean

Indicates whether all device files that are no longer on the sync list should be deleted during auto sync

deleteUnsync: boolean

Indicates whether library files that are no longer on the sync list should be deleted during auto sync

deleted: boolean

Set to true after deletion so that 'change' event is called and item is removed from UI lists.

dontNotify: boolean

Undocumented

enabled: boolean

Undocumented

handlerID: string

Gets/Sets sync handler used for media sync, e.g. 'cloud', 'usb' etc.
See mediaSyncHandlers in mediaSync.js

hasFolderSupport: boolean

Undocumented

hasPlaylistSupport: boolean

Undocumented

id: number

Gets integer id of the object

imagePath: string

Path to the image representing this device profile

isAutoSyncRunning: boolean

Indicates whether auto-sync process is currently running

isFolderBased: boolean

Indicates whether this profile is folder based, default is TRUE, but e.g. 'Google Play Music' utilizes this to FALSE

isNewlyCreated: boolean

Indicates whether this device profiles is newly created (on first connect or first registration)

isObservable: boolean

Whether this object can be listened (e.g. for 'change' event)

isStatusBarSource: boolean

Is source for status bar informations.

lastSyncTime: string

Returns last sync time

Returns

timestamp in UTC form 'YYYY-MM-DD HH:MM:SS'

name: string

Gets/Sets name of this device sync profile

objectType: string

Gets the object type as string

persistentID: string

Gets persistent id of the object

preferStars: boolean

Undocumented

profile_id: string

Undocumented

randomSelection: boolean

Undocumented

removeAAByteRate: number

Treshold (in bytes) for removeAAFromTag

removeAAFromTag: boolean

Indicates whether artwork should by removed from file tags when it is larger than removeAAByteRate treshold

resizeArtwork: boolean

Whether artwork should be resized

resizeArtworkMaxRes: number

Max. resultion to which the artwork should be resized

resyncOnMaskChange: boolean

Indicates whether files should be re-uploaded to new locations once their target locations are changed by sync mask config
If false then MediaMonkey leave them in its original locations

saveAAToFolder: boolean

Indicates whether artwork should by copied to the file folders on the device

saveAAToTag: boolean

Indicates whether artwork should by copied to the file tags on the device

scanOnConnect: boolean

Indicates whether device content should be scanned ASAP or once needed

scanning: boolean

Indicates whether content of this device is being scanned

statusInfo: Promise<any>

Undocumented

syncAAMask: string

Mask representing target filename for artwork files

syncOnConnect: boolean

Undocumented

syncOnlyFirstArtist: boolean

Indicates whether only first artist should be synced when multiple artists exists

syncOnlyFirstGenre: boolean

Indicates whether only first genre should be synced when multiple genres exists

syncPlaylists: boolean

Indicates whether playlists should be synced to the device

title: string

Gets the object title

Methods

  • Adds device/cloud track into library (currently used for cloud content scanning into user library)

    Parameters

    • track: Track

      to be added

    • updateMetadata: boolean

      Overwrite existing library metadata (if exists)

    • checkDownloadStatus: boolean

      Checks whether the track is downloaded and returns as second parameter in the promise

    Returns Promise<any>

  • Adds device/cloud tracks into library (currently used for cloud content scanning into user library)

    Parameters

    • tracks: Tracklist

      to be added

    • updateMetadata: boolean

      Overwrite existing library metadata (if exists)

    • downloadMissing: boolean

      Indicates whether the unpaired tracks should be downloaded locally

    • taskProgress: BackgroundTask
    • isFullScan: boolean

      Indicates whether the tracks is full scan (to auto-remove no longer existing tracks from library)

    Returns Promise<any>

  • Lock object to update state. Events are not called when in update state.

    Returns void

  • Returns boolean

    Undocumented

  • Returns boolean

    Undocumented

  • Updates the object every X ms when called periodically. Useful e.g. when filling lists. Can be used only in the update lock! (i.e. between beginUpdate/endUpdate)

    Parameters

    • interval: number

    Returns void

  • Commits device profile modifications into database

    Returns Promise<any>

  • Creates sync process for manipulating media sync
    see MediaSync class implementation in helpers/mediaSync.js for examples

    Parameters

    • mode: string

      can be either 'send' (manual sync) or 'auto' (auto sync)

    Returns SharedObject

  • Parameters

    Returns Promise<any>

    Undocumented

  • Parameters

    Returns Promise<any>

    Undocumented

  • Returns Promise<any>

    Undocumented

  • Unlock object from update state. beginUpdate and endUpdate must be in pair. When endUpdate is called, change event is called.

    Returns boolean

  • Parameters

    • dimX: number
    • dimY: number

    Returns string

    Undocumented

  • Parameters

    Returns Promise<any>

    Undocumented

  • Gets class name of the object.

    Returns string

  • Gets collection settings object
    see /controls/deviceConfig/syncToDevice.js for examples

    Parameters

    • idCollection: number

    Returns DeviceCollection

  • Gets folder list
    folderType param can be either 'content' (for actual content listing)
    or 'scanFromDevice' and 'syncFromDevice' for device folder configs (see /controls/deviceConfig/syncFromDevice.js for examples)

    Parameters

    • aFolderType: string

    Returns SharedList<SharedFolder>

  • Parameters

    • aFolderType: string

    Returns StringList

    Undocumented

  • Folders are supported

    Returns boolean

  • Playlists are supported

    Returns boolean

  • Returns boolean

    Undocumented

  • Parameters

    • objectType: string
    • objId: number

    Returns Promise<any>

    Undocumented

  • Gets JSON representing playlist sync config, see /controls/deviceConfig/options/pnl_Playlists.js for possible values

    Returns string

  • Gets list of supported playlist formats

    Returns StringList

  • Gets destination target mask for desired content type

    Parameters

    • maskType: string

    Returns string

  • Returns link to cached image thumbnail of the nearest specified size

    Parameters

    • Rest ...params: any[]

    Returns number

  • Gets device track by its path

    Parameters

    • DevicePath: string

    Returns Track

  • Gets device content

    Parameters

    • Rest ...params: any[]

    Returns Tracklist

    as promise

    Example

    var trcklist = Device.getTracklist('music'); <br>
    trcklist.whenLoaded().then(function () { <br>
    // all tracks are loaded here <br>
    }); <br>
  • Returns Promise<any>

    Undocumented

  • Returns string

    Undocumented

  • Parameters

    • id: number

    Returns boolean

    Undocumented

  • Returns boolean

    Undocumented

  • Loads all profile values from MMDC (MediaMonkey device configuration) file

    Parameters

    • path: string

      to the MMDC file

    Returns Promise<any>

  • Call defined method with locked data so user can access them.

    Parameters

    • func: (() => any)

      Method to call

        • (): any
        • Returns any

    Returns void

  • Parameters

    Returns Promise<any>

    Undocumented

  • Call defined method with the item locked for modifications.

    Parameters

    • Rest ...params: any[]

    Returns Promise<any>

  • Notifies that the object was changed (e.g. to force visual update etc.)

    Parameters

    • Rest ...params: any[]

    Returns void

  • Removes this device profile

    Returns Promise<any>

  • Removes device/cloud tracks from library (currently used for cloud content scanning into user library)

    Parameters

    • Rest ...params: any[]

    Returns Promise<any>

  • Restores all profile values to the defaults

    Returns Promise<any>

  • Returns void

    Undocumented

  • Saves all profile values to MMDC (MediaMonkey device configuration) file

    Parameters

    • path: string

      to the MMDC file

    Returns Promise<any>

  • Inititates scanning of device content, is done automatically when getTracklist() is called and the content hasn't been scanned yet

    Parameters

    • rescan: boolean

      whether content should be rescanned for already scanned content

    Returns void

  • Re-scans device content, is done automatically when getTracklist() is called and the content hasn't been scanned yet

    Parameters

    • rescan: boolean

      whether content should be rescanned for already scanned content

    Returns Promise<any>

  • Parameters

    • capacity: number
    • spaceUsed: number

    Returns Promise<any>

    Undocumented

  • Parameters

    Returns Promise<any>

    Undocumented

  • Parameters

    • letter: string

    Returns void

    Undocumented

  • Sets folder list as configured, see /controls/deviceConfig/syncFromDevice.js for examples
    folderType param can be either 'scanFromDevice' or 'syncFromDevice'

    Parameters

    Returns void

  • Parameters

    • id: number
    • value: boolean

    Returns void

    Undocumented

  • Sets JSON representing playlist sync config, see /controls/deviceConfig/options/pnl_Playlists.js for possible values

    Parameters

    • JSON: string

    Returns void

  • Parameters

    Returns void

    Undocumented

  • Sets destination target mask for desired content type

    Parameters

    • maskType: string
    • value: string

    Returns void

  • Returns Promise<any>

    Undocumented

  • Adds or updates device playlist into local user library (currently used for cloud content scanning into user library)

    Parameters

    • aTitle: string
    • guid: string

      playlist guid (use empty string to created new one)

    • parent_guid: string

      parent playlist guid (use empty string to insert under root)

    • last_modified: string

      last modified timestamp

    • criteria: string

      auto-playlist's criteria JSON

    • aTracks: Tracklist
    • canUsePartialPlaylists: boolean

      if TRUE then creates playlist even if not all tracks are matched/found

    Returns Promise<any>

  • Returns string

    Undocumented

Events

event_change: ((changeType, ...additionalArgs) => void)

Event is called when object is somehow changed

See App.listen

Type declaration

    • (changeType, ...additionalArgs): void
    • Parameters

      • changeType: string

        additional change type (can have values like 'tracklist', 'deleted', 'title' or undefined)

      • Rest ...additionalArgs: any[]

      Returns void

Example

app.listen(object, 'change', (changeType) => {  });
event_destroying: (() => void)

Event is called when object is going to destroy

See App.listen

Type declaration

    • (): void
    • Returns void

event_statuschange: (() => void)

Event is called when status info of the object is changed

See App.listen

Type declaration

    • (): void
    • Returns void