TV Shows - lokenx/plex-requests GitHub Wiki

GET: /tv

Summary

Returns an array of all requested tv shows.

Parameters

None

Returned JSON

{
    statusCode: 200,
    data: [
        {
            "title": "Demo TV Show",
            "tvdb": "223344",
            "released": "2010-11-27T02:34:39.000Z",
            "user": "plexuser",
            "status": {
                "downloaded": 0,
                "available": 0
            },
            "approved": true,
            "poster_path": "/",
            "created": "2016-01-07T01:06:03.860Z",
            "_id": "V9hCBdxw0fTECjvx"
        }
    ]
    meta: {}
}

GET: /tv/{id}

Summary

Returns an individual movie object.

Parameters

The id query should be an TVDB ID number

http://localhost:8000/api/v1/tv/12345

Returned JSON

{
    statusCode: 200,
    data: {
        "title": "Demo TV Show",
        "tvdb": "223344",
        "released": "2010-11-27T02:34:39.000Z",
        "user": "plexuser",
        "status": {
            "downloaded": 0,
            "available": 0
        },
        "approved": true,
        "poster_path": "/",
        "created": "2016-01-07T01:06:03.860Z",
        "_id": "V9hCBdxw0fTECjvx"
    }
    meta: {}
}

POST: /tv

Summary

Add a new tv show to Plex Requests. Will return the saved object on success.

Parameters

TV show object should be provided in the body, JSON encoded.

{
    "title": "Demo Movie",
    "tvdb": "223344",
    "released": "2010-11-27T02:34:39.000Z",
    "user": "plexuser",
    "status": {
        "downloaded": 0,
        "available": 0
    },
    "approved": true,
    "poster_path": "/",
    "created": "2016-01-07T01:06:03.860Z",
    "_id": "V9hCBdxw0fTECjvx"
}

Returned JSON

{
    "statusCode": 200,
    "data": {
        "title": "Demo Movie",
        "tvdb": "223344",
        "released": "2010-11-27T02:34:39.000Z",
        "user": "plexuser",
        "status": {
            "downloaded": 0,
            "available": 0
        },
        "approved": true,
        "poster_path": "/",
        "created": "2016-01-07T01:06:03.860Z",
        "_id": "V9hCBdxw0fTECjvx"
    },
    "meta": {}
}

DELETE: /tv

Summary

Removes a tv show from Plex Requests. This requires authenticating with an admin user JWT.

Parameters

TV show TVDB ID should be provided in the body, JSON encoded.

{
    "tvdb": "12345",
    "title": "Fake TV Show Title"
}

Returned JSON

{
    "statusCode": 200,
    "data": {
        "message": "Removed the tv show Fake TV Show Title"
    },
    "meta": {}
}  

PUT: /tv

Summary

Updates a single tv show object. All fields can be updated. This requires authenticating with an admin user JWT.

Parameters

TV object should be provided in the body, JSON encoded.

{
    "tvdb": 223344,
    "update": {
        "status": {
            "downloaded": 10,
            "available": 10
        }
    }
}

Returned JSON

{
    "statusCode": 200,
    "data": {
        "title": "Demo Movie",
        "tvdb": "223344",
        "released": "2010-11-27T02:34:39.000Z",
        "user": "plexuser",
        "status": {
            "downloaded": 10,
            "available": 10
        },
        "approved": true,
        "poster_path": "/",
        "created": "2016-01-07T01:06:03.860Z",
        "_id": "V9hCBdxw0fTECjvx"
    },
    "meta": {}
}