summaryrefslogtreecommitdiffstats
path: root/README.md
blob: fbd37690e8e70949c7ad8219ea7f20b77d386627 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# MediaScanner Service

## Overview

MediaScanner service use the database from respective *lightmediascanner* media scan, and also
triggers playlist updates when storage media changes.

## Verbs

| Name           | Description                | JSON Parameters                        |
|:---------------|:---------------------------|:---------------------------------------|
| subscribe      | subscribe to media events  | *Request:* {"value":"media_added"}     |
| unsubscribe    | unsubcribe to media events | *Request:* {"value":"media_added"}     |
| media_result   | get current media playlist | See **media_result Reporting** section |

### media_result Reporting

JSON response for *media_result* request parameters is an array of dictionary entries
with the following fields.

| Name        | Description                                 |
|:------------|---------------------------------------------|
| duration    | length of track in milliseconds             |
| path        | uri escaped path to media on filesystem     |
| title       | title for media entey                       |
| album       | album name for media entry                  |
| artist      | artist name for media entry                 |
| genre       | genre type for media entry                  |
| type        | media entry data type *(e.g audio, video)*  |

If no media is present, the an empty array will be returned.

## Events

| Name           | Description                                        |
|:---------------|:---------------------------------------------------|
| media_added    | event that reports storage media insertion         |
| media_removed  | event that reports storage media removal           |

### media_added Event JSON Response

JSON response for this event has the same results as documented in **media_result Reporting ** sections.

### media_removed Event JSON Response

JSON response has a single field **Path** that is the location of media that has been removed.