com.webos.service.mediaindexer

API Summary

Provides the functionalities that scan media files (audios, videos, images) from internal / external storage devices such as the usb devices and extracts the meta data.

Overview of the API

For connected storage devices, detects media contents and extracts meta data. External services using API provided by the service can be informed when the status of connected devices or media contents are changed. Information of connected devices and media contents is also stored in DB via com.webos.mediadb.

Currently supported type of devices are as follows:

  • Internal storage devices
  • USB devices

Methods

getAudioList

Description

Gets the available audio file list included in attached devices.

Note: If the uri is specified, the audio file list for specified uri is provided. Else the audio file list for all attached devices is provided.

Parameters

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the device mounted on the target that contains the source path of the audio files.

The format is given as: <protocol name>://<device uuid>

Example: msc://D94A-BE4D

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Default: false

Note: Notifications are not provided when an entry is removed from the list (physical devices are detached). In this case, the user is notified from other external service such as physical device manager.

countOptionalNumber

Limits the number of entries in the returned audio file list.

Default: 500

Call Returns

Name

Required

Type

Description

audioListOptionalObject: audioList

Indicates the supported device types.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation. 

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

errorTextOptionalString

Indicates the reason for the failure of the operation.

Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly.

subscribedOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorTextOptionalString

Indicates the reason for the failure of the operation.

Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly.

errorCodeOptionalNumber

The error code for the operation.

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

audioListOptionalObject: audioList

Specifies supported device types.

subscribedOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Example

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getAudioList '{}'

Response:

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "audioList": {
      "results": [
         {
            "last_modified_date": "Wed Jul 22 09:09:38 2020 GMT",
            "duration": 348,
            "file_path": "file:///tmp/usb/sdh/sdh1/Sample-OGG-File.ogg",
            "album": "Ninja Tuna",
            "genre": "Electronic",
            "artist": "Mr. Scruff",
            "title": "Kalimba",
            "uri": "msc://B5E0-BBB2/tmp/usb/sdg/sdg1/Sample-OGG-File.ogg",
            "file_size": 6984260,
            "thumbnail": ""
         },
         {
            "last_modified_date": "Thu Jul 30 06:48:04 2020 GMT",
            "duration": 10,
            "file_path": "file:///tmp/usb/sdh/sdh1/tagtest.ID3v2.4.mp3",
            "album": "Test Album",
            "genre": "Classical",
            "artist": "Test Artist",
            "title": "Test Name",
            "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/tagtest.ID3v2.4.mp3",
            "file_size": 184861,
            "thumbnail": "/media/.thumbnail/D94A-BE4D/9513454098549223.jpg"
         }
      ],
      "count": 2
   }
}

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getAudioList '{"uri":"msc://D94A-BE4D"}'

Response:

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "audioList": {
      "results": [
         {
            "last_modified_date": "Thu Jul 30 06:48:04 2020 GMT",
            "duration": 10,
            "file_path": "file:///tmp/usb/sdh/sdh1/tagtest.ID3v2.4.mp3",
            "album": "Test Album",
            "genre": "Classical",
            "artist": "Test Artist",
            "title": "Test Name",
            "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/tagtest.ID3v2.4.mp3",
            "file_size": 184861,
            "thumbnail": "/media/.thumbnail/D94A-BE4D/9513454098549223.jpg"
         }
      ],
      "uri": "msc://D94A-BE4D",
      "count": 1
   }
}

# luna-send -i -f luna://com.webos.service.mediaindexer/getAudioList '{"subscribe":true}'

Response :

{
   "subscribed": true,
   "returnValue": true
}

Subscription response: 

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "audioList": [
      {
         "results": [
            {
               "last_modified_date": "Tue Nov 25 06:10:08 2014 GMT",
               "duration": 260,
               "dirty": false,
               "file_path": "file:///tmp/usb/sdg/sdg1/MetaThumbnail/01_Jalsa.mp3",
               "album": "Jalsa - (2008)",
               "genre": "Telugu",
               "artist": "Baba Sehgal, Rita",
               "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/MetaThumbnail/01_Jalsa.mp3",
               "title": "[iSongs.info] 01 - Jalsa",
               "file_size": 4243260,
               "thumbnail": "/media/.thumbnail/D7FE-42B8/8257472925753254.jpg"
            },
            {
               "last_modified_date": "Mon Sep 14 05:53:28 2020 GMT",
               "duration": 226,
               "dirty": false,
               "file_path": "file:///tmp/usb/sdg/sdg1/albumart/Miss_A.mp3",
               "album": "TestAlbum",
               "genre": "Telugu",
               "artist": "Miss A",
               "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/albumart/Miss_A.mp3",
               "title": "Good Bye Baby",
               "file_size": 5453302,
               "thumbnail": "/media/.thumbnail/D7FE-42B8/1208322061333152.jpg"
            }
         ],
         "count": 2
      }
   ]
}

# luna-send -i -f luna://com.webos.service.mediaindexer/getAudioList '{
   "subscribe":true,
   "count":1
}'

Response:

{
   "subscribed": true,
   "returnValue": true
}

Subscription response 1:

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "audioList": {
      "results": [
         {
            "last_modified_date": "Tue Nov 25 06:10:08 2014 GMT",
            "duration": 260,
            "dirty": false,
            "file_path": "file:///tmp/usb/sdg/sdg1/MetaThumbnail/01_Jalsa.mp3",
            "album": "Jalsa - (2008)",
            "genre": "Telugu",
            "artist": "Baba Sehgal, Rita",
            "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/MetaThumbnail/01_Jalsa.mp3",
            "title": "[iSongs.info] 01 - Jalsa",
            "file_size": 4243260,
            "thumbnail": "/media/.thumbnail/D7FE-42B8/479067904926436.jpg"
         }
      ],
      "count": 1
   }
}

Subscription response 2:

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "audioList": {
      "results": [
         {
            "last_modified_date": "Mon Sep 14 05:53:28 2020 GMT",
            "duration": 226,
            "dirty": false,
            "file_path": "file:///tmp/usb/sdg/sdg1/albumart/Miss_A.mp3",
            "album": "TestAlbum",
            "genre": "Telugu",
            "artist": "Miss A",
            "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/albumart/Miss_A.mp3",
            "title": "Good Bye Baby",
            "file_size": 5453302,
            "thumbnail": "/media/.thumbnail/D7FE-42B8/106457924970666.jpg"
         }
      ],
      "count": 1
   }
}

getDeviceList

Description

Gets the list of all the attached storage devices.

Note: The list can contain devices that are currently attached or the devices attached in the past.

Parameters

Name

Required

Type

Description

subscribeRequiredBoolean

Indicates if subscribed to get the notifications.

Possible values are:

  • true: Subscribe for notifications.
  • false: Not subscribed

Default: false

Call Returns

Name

Required

Type

Description

pluginListRequiredObject array: pluginList

Indicates the supported device types.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation.

errorTextOptionalString

Indicates the reason for the failure of the operation.

subscribedOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Subscription Returns

Name

Required

Type

Description

pluginListRequiredObject array: pluginList

Indicates the supported device types.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true:  Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation.

errorTextOptionalString

Indicates the reason for the failure of the operation.

subscribedOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Example

# luna-send -n 2 -f luna://com.webos.service.mediaindexer/getDeviceList '{"subscribe":true}'

Response:

{
   "subscribed": true,
   "returnValue": true
}

Subscription response:

{
   "pluginList": [
      {
         "deviceList": [
            {
               "name": "Ultra",
               "imageCount": 0,
               "uri": "msc://B5E0-BBB2",
               "videoCount": 1,
               "available": true,
               "icon": "",
               "audioCount": 34,
               "description": "Ultra"
            },
            {
               "name": "Cruzer Blade",
               "imageCount": 33,
               "uri": "msc://D94A-BE4D",
               "videoCount": 7,
               "available": true,
               "icon": "",
               "audioCount": 35,
               "description": "Cruzer Blade"
            }
         ],
         "active": true,
         "uri": "msc"
      },
      {
         "deviceList": [],
         "active": false,
         "uri": "storage"
      }
   ],
   "returnValue": true
}

getAudioMetadata

Description

Gets the detailed meta data information of the specified uri for the given audio file.

Parameters

Name

Required

Type

Description

uriRequiredString

Indicates the uri of the audio file.

Example: msc://D94A-BE4D/tmp/usb/sdg/sdg1/SampleAudio.mp3

Call Returns

Name

Required

Type

Description

metadataOptionalObject array: AudioMetadata

Indicates the meta data information of specified audio file.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation.

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

errorTextOptionalString

Indicates the reason for the failure of the operation.

Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly.

Example

# luna://com.webos.service.mediaindexer/getAudioMetadata '{"uri":"msc://D94A-BE4D/tmp/usb/sdh/sdh1/tagtest.ID3v2.4.mp3"}'

Response: 

{
   "errorCode": 0,
   "returnValue": true,
   "metadata": {
      "sample_rate": 44100,
      "file_path": "file:///tmp/usb/sdh/sdh1/tagtest.ID3v2.4.mp3",
      "track": "3/4",
      "date_of_creation": "2008-12-29",
      "genre": "Classical",
      "duration": 10,
      "last_modified_date": "Thu Jul 30 06:48:04 2020 GMT",
      "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/tagtest.ID3v2.4.mp3",
      "album": "Test Album",
      "type": "audio",
      "thumbnail": "/media/.thumbnail/D94A-BE4D/4470986424276816.jpg",
      "bit_rate": 110,
      "hash": "13605171757709551616",
      "title": "Test Name",
      "dirty": false,
      "artist": "Test Artist",
      "mime": "audio/mpeg",
      "total_tracks": "",
      "file_size": 184861,
      "channels": 2,
      "album_artist": "Test Album Artist",
      "bit_per_sample": "",
      "lyric": ""
   },
   "errorText": "No Error"
}

getVideoList

Description

Gets the available video files list included in the attached devices.

Note: If the uri is specified, the video file list for specified uri is provided. Else the video file list for all attached devices is provided.

Parameters

Name

Required

Type

Description

uriOptionalString

Specifies uri of device mounted on target that provided video files belongs to.

Format: <protocol name>://<device uuid>.

Example: msc://D94A-BE4D

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Default: false

Note: Notifications are not provided when an entry is removed from the list (physical devices are detached). In this case, the user is notified from other external service such as physical device manager.

countOptionalNumber

Limits the number of entries in the returned video file list.

Default: 500

Call Returns

Name

Required

Type

Description

videoListOptionalObject: videoList

Indicates the supported device types.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation.

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

errorTextOptionalString

Indicates the reason for the failure of the operation.

Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly.

subscribedOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
errorTextOptionalString

Indicates the reason for the failure of the operation.

Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly.

errorCodeOptionalNumber

The error code for the operation.

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

videoListOptionalObject: videoList

Indicates the supported device types.

Example

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getVideoList '{}'

Response: 

{
   "errorCode": 0,
   "returnValue": true,
   "videoList": {
      "results": [
         {
            "width": 1920,
            "duration": 205,
            "file_path": "file:///tmp/usb/sdg/sdg1/video/SampleVideofiles1.mp4",
            "last_modified_date": "Fri Aug 14 03:55:22 2020 GMT",
            "thumbnail": "/media/.thumbnail/B5E0-BBB2/1716759322466815.jpg",
            "height": 1080,
            "file_size": 264881271,
            "uri": "msc://B5E0-BBB2/tmp/usb/sdg/sdg1/video/SampleVideofiles1.mp4",
            "title": "SampleVideofiles1"
         },
         {
            "width": 1920,
            "duration": 209,
            "file_path": "file:///tmp/usb/sdh/sdh1/SampleVideofiles2.mp4",
            "last_modified_date": "Wed Jul 22 09:07:16 2020 GMT",
            "thumbnail": "/media/.thumbnail/D94A-BE4D/3810749630515133.jpg",
            "height": 1080,
            "file_size": 268264916,
            "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/SampleVideofiles2.mp4",
            "title": "SampleVideofiles2"
         }
      ],
      "count": 2
   },
   "errorText": "No Error"
}

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getVideoList '{"uri":"msc://D94A-BE4D"}'

Response:

{
   "errorCode": 0,
   "returnValue": true,
   "videoList": {
      "results": [
         {
            "width": 1920,
            "duration": 209,
            "file_path": "file:///tmp/usb/sdh/sdh1/SampleVideofiles2.mp4",
            "last_modified_date": "Wed Jul 22 09:07:16 2020 GMT",
            "thumbnail": "/media/.thumbnail/D94A-BE4D/1176055898542105.jpg",
            "height": 1080,
            "file_size": 268264916,
            "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/SampleVideofiles2.mp4",
            "title": "SampleVideofiles2"
         }
      ],
      "uri": "msc://D94A-BE4D",
      "count": 1
   },
   "errorText": "No Error"
}

# luna-send -i -f luna://com.webos.service.mediaindexer/getVideoList '{"subscribe":true}'

Response :

{
   "subscribed": true,
   "returnValue": true
}

Subscription response:

{
   "errorCode": 0,
   "returnValue": true,
   "videoList": [
      {
         "results": [
            {
               "last_modified_date": "Mon Nov  5 23:48:20 2018 GMT",
               "duration": 9,
               "dirty": false,
               "file_path": "file:///tmp/usb/sdg/sdg1/MetaThumbnail/SampleVideo_360x240_1mb.mkv",
               "thumbnail": "/media/.thumbnail/D7FE-42B8/1268526786254962.jpg",
               "height": 240,
               "file_size": 1055721,
               "title": "SampleVideo_360x240_1mb",
               "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/MetaThumbnail/SampleVideo_360x240_1mb.mkv",
               "width": 320
            },
            {
               "last_modified_date": "Mon Nov  5 23:48:20 2018 GMT",
               "duration": 9,
               "dirty": false,
               "file_path": "file:///tmp/usb/sdg/sdg1/scan1/SampleVideo_360x240_1mb.mkv",
               "thumbnail": "/media/.thumbnail/D7FE-42B8/1123462817394724.jpg",
               "height": 240,
               "file_size": 1055721,
               "title": "SampleVideo_360x240_1mb",
               "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/scan1/SampleVideo_360x240_1mb.mkv",
               "width": 320
            }
         ],
         "count": 2
      }
   ],
   "errorText": "No Error"
}

# luna-send -i -f luna://com.webos.service.mediaindexer/getVideoList '{
   "subscribe":true,
   "count":1
}'

Response :

{
   "subscribed": true,
   "returnValue": true
}

Subscription response:

{
   "errorCode": 0,
   "returnValue": true,
   "videoList": {
      "results": [
         {
            "last_modified_date": "Mon Nov  5 23:48:20 2018 GMT",
            "duration": 9,
            "dirty": false,
            "file_path": "file:///tmp/usb/sdg/sdg1/MetaThumbnail/SampleVideo_360x240_1mb.mkv",
            "thumbnail": "/media/.thumbnail/D7FE-42B8/685728599232055.jpg",
            "height": 240,
            "file_size": 1055721,
            "title": "SampleVideo_360x240_1mb",
            "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/MetaThumbnail/SampleVideo_360x240_1mb.mkv",
            "width": 320
         }
      ],
      "count": 1
   },
   "errorText": "No Error"
}

Subscription response 2:

{
   "errorCode": 0,
   "returnValue": true,
   "videoList": {
      "results": [
         {
            "last_modified_date": "Mon Nov  5 23:48:20 2018 GMT",
            "duration": 9,
            "dirty": false,
            "file_path": "file:///tmp/usb/sdg/sdg1/scan1/SampleVideo_360x240_1mb.mkv",
            "thumbnail": "/media/.thumbnail/D7FE-42B8/677091961220339.jpg",
            "height": 240,
            "file_size": 1055721,
            "title": "SampleVideo_360x240_1mb",
            "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/scan1/SampleVideo_360x240_1mb.mkv",
            "width": 320
         }
      ],
      "count": 1
   },
   "errorText": "No Error"
}

getVideoMetadata

Description

Gets the detailed meta data information for the specified uri of the video file.

Parameters

Name

Required

Type

Description

uriRequiredString

Indicates the uri of the video file.

Example: msc://D94A-BE4D/tmp/usb/sdg/sdg1/SampleVideo.mp4

Call Returns

Name

Required

Type

Description

metadataOptionalObject array: VideoMetadata

Indicates the meta data information of specified video file.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation.

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

errorTextOptionalString

Indicates the reason for the failure of the operation.

Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly.

Example

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getVideoMetadata '{"uri":"msc://D94A-BE4D/tmp/usb/sdh/sdh1/SampleVideofiles2.mp4"}'

Response:

{
   "errorCode": 0,
   "returnValue": true,
   "metadata": {
      "video_codec": "H.264 / AVC",
      "date_of_creation": "",
      "last_modified_date": "Wed Jul 22 09:07:44 2020 GMT",
      "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/SampleVideofiles2.mp4",
      "height": 1080,
      "type": "video",
      "thumbnail": "/media/.thumbnail/D94A-BE4D/1740291740485930.jpg",
      "hash": "13604488937709551616",
      "title": "SampleVideofiles2.mp4",
      "width": 1920,
      "dirty": false,
      "frame_rate": "24000/1001",
      "mime": "video/mp4",
      "audio_codec": "MPEG-4 AAC audio",
      "file_size": 264881271,
      "file_path": "file:///tmp/usb/sdh/sdh1/SampleVideofiles2.mp4",
      "duration": 205
   },
   "errorText": "No Error"
}

getImageList

Description

Gets all the available image file list included in the attached devices.

Note: If the uri is specified, the image file list for specified uri is provided. Else the image file list for all attached devices is provided.

Parameters

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the device mounted on the target that contains the source path of the image files.

Format: <protocol name>://<device uuid>.

Example: msc://D94A-BE4D

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Default: false

Note: Notifications are not provided when an entry is removed from the list (physical devices are detached). In this case, the user is notified from other external service such as physical device manager.

countOptionalNumber

Limits the number of entries in the returned image file list.

Default: 500

Call Returns

Name

Required

Type

Description

imageListOptionalObject: imageList

Specifies the supported device types. See imageList for details.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation.

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

errorTextOptionalString

Indicates the reason for the failure of the operation.

Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly.

subscribedOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications.
  • false: Not subscribed.
errorTextOptionalString

Indicates the reason for the failure of the operation.

Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly.

errorCodeOptionalNumber

The error code for the operation.

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

imageListOptionalObject: imageList

Indicates the supported device types. See imageList for details.

Example

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getImageList '{}'

Response:

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "imageList": {
      "results": [
         {
            "width": 1024,
            "last_modified_date": "Fri Aug 14 03:54:08 2020 GMT",
            "uri": "msc://B5E0-BBB2/tmp/usb/sdg/sdg1/image/SampleImage1.jpg",
            "title": "SampleImage1",
            "file_size": 197377,
            "height": 768,
            "file_path": "file:///tmp/usb/sdg/sdg1/image/SampleImage1.jpg"
         },
         {
            "width": 1024,
            "last_modified_date": "Wed Jul 22 09:04:16 2020 GMT",
            "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/SampleImage2.jpg",
            "title": "SampleImage2",
            "file_size": 199429,
            "height": 768,
            "file_path": "file:///tmp/usb/sdh/sdh1/SampleImage2.jpg"
         }
      ],
      "count": 2
   }
}

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getImageList '{"uri":"msc://D94A-BE4D"}'

Response:

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "imageList": {
      "results": [
         {
            "width": 1024,
            "last_modified_date": "Wed Jul 22 09:04:16 2020 GMT",
            "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/SampleImage2.jpg",
            "title": "SampleImage2",
            "file_size": 199429,
            "height": 768,
            "file_path": "file:///tmp/usb/sdh/sdh1/SampleImage2.jpg"
         }
      ],
      "uri": "msc://D94A-BE4D",
      "count": 1
   }
}

# luna-send -i -f luna://com.webos.service.mediaindexer/getImageList '{"subscribe":true}'

Response:

{
   "subscribed": true,
   "returnValue": true
}

Subscription response:

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "imageList": [
      {
         "results": [
            {
               "width": 350,
               "last_modified_date": "Thu Jul 14 07:05:32 2016 GMT",
               "dirty": false,
               "file_path": "file:///tmp/usb/sdg/sdg1/scan1/Apink_ Promise U.jpg.jpg",
               "height": 196,
               "file_size": 56228,
               "title": "Apink_ Promise U.jpg",
               "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/scan1/Apink_ Promise U.jpg.jpg"
            },
            {
               "width": 3092,
               "last_modified_date": "Mon Sep 14 02:06:24 2020 GMT",
               "dirty": false,
               "file_path": "file:///tmp/usb/sdg/sdg1/MetaThumbnail/thorsmork.jpg",
               "height": 1616,
               "file_size": 1060326,
               "title": "thorsmork",
               "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/MetaThumbnail/thorsmork.jpg"
            }
         ],
         "count": 2
      }
   ]
}

# luna-send -i -f luna://com.webos.service.mediaindexer/getImageList '{
   "subscribe":true,
   "count":1
}'

Response :

{
   "subscribed": true,
   "returnValue": true
}

Subscription response:

{
   "errorCode": 0,
   "returnValue": true,
   "errorText": "No Error",
   "imageList": {
      "results": [
         {
            "width": 350,
            "last_modified_date": "Thu Jul 14 07:05:32 2016 GMT",
            "dirty": false,
            "file_path": "file:///tmp/usb/sdg/sdg1/scan1/Apink_ Promise U.jpg.jpg",
            "height": 196,
            "file_size": 56228,
            "title": "Apink_ Promise U.jpg",
            "uri": "msc://D7FE-42B8/tmp/usb/sdg/sdg1/scan1/Apink_ Promise U.jpg.jpg"
         }
      ],
      "count": 1
   }
}

getImageMetadata

Description

Gets the detailed meta data information of specified uri of the image file.

Parameters

Name

Required

Type

Description

uriRequiredString

Indicates the uri of the audio file.

Example: msc://D94A-BE4D/tmp/usb/sdg/sdg1/SampleImage.jpg

Call Returns

Name

Required

Type

Description

metadataOptionalObject array: imageList

Indicates the metadata information of specified audio file.

returnValueRequiredBoolean

Indicates the status of the operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation.

Note: Currently, it returns 0 even when the returnValue is true and returns -1 if JSON parsing fails.

errorTextOptionalString

Indicates the reason for the failure of the operation.

Note: Currently, it returns "No Error" even when the returnValue is true. If JSON parsing fails, then errorText is updated accordingly.

Example

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getImageMetadata '{"uri":"msc://D94A-BE4D/tmp/usb/sdh/sdh1/SampleImage2.jpg"}'

Response:

{
   "errorCode": 0,
   "returnValue": true,
   "metadata": {
      "date_of_creation": "",
      "geo_location_city": "",
      "last_modified_date": "Wed Jul 22 09:04:16 2020 GMT",
      "uri": "msc://D94A-BE4D/tmp/usb/sdh/sdh1/SampleImage2.jpg",
      "height": 768,
      "type": "image",
      "hash": "13604488729709551616",
      "title": "SampleImage2",
      "width": 1024,
      "dirty": false,
      "mime": "image/jpeg",
      "file_path": "file:///tmp/usb/sdh/sdh1/SampleImage2.jpg",
      "geo_location_latitude": "",
      "geo_location_longitude": "",
      "geo_location_country": "",
      "file_size": 199429
   },
   "errorText": "No Error"
}

getMediaDbPermission

Description

Enables the external services or applications to acquire, access permission of the DB managed by the media indexer service.

Parameters

Name

Required

Type

Description

serviceNameRequiredString

Indicates the name of the external services or the applications to access the DB of the media indexer service.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation.

Possible values are:

  • true: Indicates that the operation was successful.
  • false: Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the operation.

errorTextOptionalString

Indicates the reason for the failure of the operation.

Example

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getMediaDbPermission '{"serviceName":"com.webos.mediaindexer.app.qml"}'

Response:

{
   "returnValue":true
}

# luna-send -n 1 -f luna://com.webos.service.mediaindexer/getMediaDbPermission '{}'

Response:

{
   "errorCode":-1,
   "returnValue":false,
   "errorText":"serviceName field is mandatory input"
}

Objects

pluginList

Defines the supported device types by the media indexer service.

Name

Required

Type

Description

uriOptionalString

Specifies the supported device type.

Possible values are:

  • msc: usb devices
  • storage: internal storage devices
activeOptionalBoolean

Indicates if the state of device can be changed.

Possible values are:

  • true: Subscribers can receive device status when it is changed
  • false: Subscribers cannot receive device status
deviceListOptionalObject: deviceList

Contains the detailed information about currently/previously attached devices.

deviceList

Provides the detailed information about the specific device connected to the media indexer service.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the device mounted on the target.

nameOptionalString

Indicates the human-readable device name.

availableOptionalBoolean

Indicates if the device currently available.

Possible values are:

  • true: The device is currently available
  • false: The device is currently not available
iconOptionalString

Indicates the location of a device identification icon.

imageCountOptionalNumber

Indicates the number of image files stored in the connected devices.

videoCountOptionalNumber

Indicates the number of video files stored in the connected devices.

audioCountOptionalNumber

Indicates the number of audio files stored in the connected devices.

descriptionOptionalString

Contains a human-readable device description.

audioList

Includes information about the uri of the devices, total number of audio files inside and requested result of audio files.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the device mounted on the target.

countOptionalNumber

Indicates the number of audio files included in the specified device.

resultsOptionalObject array: AudioList

Contains the information of each audio file provided as an array format. 

AudioList

Contains the detailed information about the audio files.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the audio file.

last_modified_dateOptionalString

Contains the last file modification date information.

file_sizeOptionalNumber

Indicates the file size in bytes.

file_pathOptionalString

Indicates the accessible uri of the audio file (for playback usage).

titleOptionalString

Indicates the title information of the audio file.

durationOptionalNumber

Indicates the duration of the given video file (unit : second).

thumbnailOptionalString

Contains the thumbnail path information of the corresponding audio file.

genreOptionalString

Indicates the genre of the specified audio file.

albumOptionalString

Contains the album information of the specified audio file.

artistOptionalString

Indicates the artist information for the specified audio file.

AudioMetadata

Contains the information about the AudioList, and also provides detailed information that are not included in AudioList.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the audio file.

typeOptionalString

Indicates the type of the file.

Possible values are :

  • audio
  • video
  • image
last_modified_dateOptionalString

Contains the last file modification date information.

file_sizeOptionalNumber

Indicates the file size in bytes.

file_pathOptionalString

Indicates the accessible uri of the audio file (for playback usage).

titleOptionalString

Indicates the title information of audio file.

durationOptionalNumber

Indicates the duration of the given video file (unit : second).

thumbnailOptionalString

Contains the thumbnail path information of the corresponding audio file.

mimeOptionalString

Indicates the mime type information of the audio file.

date_of_creationOptionalString

Contains the information of the recording date for the specified audio file.

genreOptionalString

Indicates the genre of the specified audio file.

albumOptionalString

Contains the album information for the specific audio file.

artistOptionalString

Contains the artist information for the specified audio file.

album_artistOptionalString

Contains the album artist information for the specified audio file.

Note: Distinct from artists for the tracks that constitute a release. Example: Various Artists

trackOptionalString

Contains the number information for the specified audio file.

total_trackOptionalString

Indicates the total tracks of a release that belong to the specified audio file.

sample_rateOptionalNumber

Contains the sampling rate information of the audio file.

bit_per_sampleOptionalString

Indicates the number of bits of information in each sample for the specified audio file.

channelOptionalNumber

Contains the information of the number of channels for a specified audio file.

lyricOptionalString

Contains the lyric information for the specified audio file.

bit_rateOptionalNumber

Contains the bitrate information for the specified audio file.

hashOptionalString

Indicates the value that specifies if an audio file has been modified or not.

Note: The property is intended for internal usage only.

dirtyOptionalBoolean

Indicates if the device includes audio files.

Possible values are:

  • true: detached
  • false: attached

Note: The property is intended for internal usage only.

videoList

Includes information about the uri of devices, total number of video files inside and requested result of the video files.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the device mounted on the target.

countOptionalNumber

Indicates the number of video files included in the specified device.

resultsOptionalString

Contains the information of each audio file provided in an array format.

VideoList

Contains the detailed information about the video files.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the given video file.

last_modified_dateOptionalString

Contains the last file modification date information.

file_sizeOptionalNumber

Indicates the file size in bytes.

file_pathOptionalString

Indicates the accessible uri of the video file (for playback usage).

titleOptionalString

Indicates the title of the given video file.

durationOptionalNumber

Indicates the duration of the given video file (unit : second).

thumbnailOptionalString

Contains the thumbnail path information of the corresponding video file.

widthOptionalNumber

Indicates the width of the given video file.

heightOptionalNumber

Indicates the height of the given video file.

VideoMetadata

Contains the information about the VideoList, provides information about the video files that are not included in the VideoList.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the given video file.

titleOptionalString

Indicates the title of the given video file.

typeOptionalString

Indicates the type of the file.

Possible values are :

  • audio
  • video
  • image
last_modified_dateOptionalString

Contains the last file modification date information.

file_sizeOptionalNumber

Indicates the file size in bytes.

file_pathOptionalString

Indicates the accessible uri of the video file (for playback usage).

durationOptionalNumber

Indicates the duration information of the video file (unit : second).

thumbnailOptionalString

Contains the thumbnail path information of the corresponding video file.

mimeOptionalString

Indicates the mime type information of the given video file.

date_of_creationOptionalString

Indicates the date of creation for the given image file.

widthOptionalNumber

Indicates the width of the given video file.

heightOptionalNumber

Indicates the height of the given video file.

frame_rateOptionalNumber

Indicates the frame rate information of the given video file.

video_codecOptionalString

Indicates the video codec information.

audio_codecOptionalString

Indicates the audio codec information.

hashOptionalString

Indicates the value that specifies if an audio file has been modified or not.

Note: The property is intended for internal usage only.

dirtyOptionalBoolean

Indicates if the device includes audio files.

Possible values are:

  • true: detached
  • false: attached

Note: The property is intended for internal usage only.

imageList

Includes information about uri of the devices, total number of image files inside and requested result of the image files.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the device mounted on the target.

countOptionalNumber

Indicates the number of audio files included in the specified device.

resultsOptionalObject array: ImageList

Contains the information of each audio file provided in an array format.

ImageList

Detailed information about video files.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the image file.

last_modified_dateOptionalString

Contains the last file modification date information.

file_sizeOptionalNumber

Indicates the file size in bytes.

file_pathOptionalString

Indicates the absolute file path of the image file.

titleOptionalString

Indicates the title of the given image file.

widthOptionalNumber

Indicates the width of the given image.

heightOptionalNumber

Indicates the height of the given image.

ImageMetadata

Contains the information in the ImageList, and also provides detailed information that are not included in ImageList.

Name

Required

Type

Description

uriOptionalString

Indicates the uri of the image file.

typeOptionalString

Indicates the type of the file.

Possible values are :

  • audio
  • video
  • image
mimeOptionalString

Indicates the mime type of the image file.

last_modified_dateOptionalString

Contains the last file modification date information.

date_of_creationOptionalString

Indicates the date of creation for the given image file.

file_sizeOptionalNumber

Indicates the file size in bytes.

file_pathOptionalString

Indicates the absolute file path of the image file.

titleOptionalString

Indicates the title of the given image file.

widthOptionalNumber

Indicates the width of the given image.

heightOptionalString

Indicates the height of the given image.

geo_location_longtitudeOptionalString

Specifies the longitude information of the given image.

geo_location_latitudeOptionalString

Specifies the latitude information of the given image.

geo_location_countryOptionalString

Specifies the country information of the given image.

geo_location_cityOptionalString

Specifies the city information of the image.

hashOptionalString

Indicates the value that specifies if an audio file has been modified or not.

Note: The property is intended for internal usage only.

dirtyOptionalBoolean

Indicates if the device includes audio files.

Possible values are:

  • true: detached
  • false: attached

Note: The property is intended for internal usage only.

Contents