Skip to content

(Chihiro) Download Queue

RePod edited this page Nov 19, 2017 · 1 revision

Most of this information is based on the PS3/Vita queues and may not accurately reflect PS4.
PSDLE uses three (and another) URLs to interface with the Download Queue, one of which is unique to the PS4. They can be seen in repod.psdle.config.dlQueue, and are as follows:

Local Key Usage
base URL to write to PS3 or Vita.
ps4 URL to write to PS4.
status URL to read all queues or to remove items.
status2 Currently unused (by PSDLE) and undocumented.

Reading from the Download Queue

This is done by repod.psdle.dlQueue.batch.get().
Uses the status URL described above.

Most of the heavy lifting is done by the URL's variables, but the most important one is platformString. platformString chooses which queue to read from, thus it is updated for each intended console to gather the whole queue.

The requested URL returns a JSON object with a data object property which contains a notifications array property. The contents of notifications is an index list of items in the requested queue.

Writing to the Download Queue

PS3 and Vita download queue writes use the same format, while the PS4 is slightly different.
The request is generated and sent by repod.psdle.dlQueue.batch.send().
The base of the request is an object with the following properties:

Key Description Type Value(s) or Example
platformString Platform queue to write to. String ps4 / ps3 / vita
contentId PS3/Vita only. Unique item ID. String AB0000-ABCD00000_00-ABCDEFGHIJLMNO00
entitlementId PS4 only. Unique item ID. String AB0000-ABCD00000_00-ABCDEFGHIJLMNO00
clientId PS4 only. Probably the Nth console. Integer 1 (default)
cancel Specify intent to remove. String usercancelled

The finalized object must then be placed as the 0th index in an array.
There may potentially be a way to combine them and work in the same array, but this is untested.

After this step, the request data should look like this for PS3 or Vita:

[{
    platformString: 'ps3',
    contentId: 'AB0000-ABCD00000_00-ABCDEFGHIJLMNO00'
}]

Or this for PS4:

[{
    platformString: 'ps4',
    entitlementId: 'AB0000-ABCD00000_00-ABCDEFGHIJLMNO00',
    clientId: 1
}]

If writing to PS3/Vita, the data is good to go. If writing to PS4 there is one more step.
PS4 requests must be the value of a notifications key in an object:

{
  'notifications':
    [{
        platformString: 'ps4',
        entitlementId: 'AB0000-ABCD00000_00-ABCDEFGHIJLMNO00',
        clientId: 1
    }]
}

After this, the entire request body is converted to a string via JSON.stringify() and sent via AJAX to the proper URL (base for PS3/Vita, ps4 for PS4) with a contentType of application/json; charset=utf-8 and dataType of json.