CemUI icon indicating copy to clipboard operation
CemUI copied to clipboard

Course downloads should use Protobuf format

Open Tarnadas opened this issue 7 years ago • 3 comments

The zip download format is only meant as a fallback for browsers, because you cannot use the cemu-smm library on client side.

The protobuf requests will decrease server load by a HUGE amount.

cemu-smm has functions to easily handle the Protobuf format:

import { deserialize, loadSave } from 'cemu-smm';

(async () => {
  const requestedData = /* make your request here */
  const course = await deserialize(requestedData)
  const save = await loadSave(/* path to save */)
  await save.addCourse(course)
})()

Tarnadas avatar Jan 12 '18 15:01 Tarnadas

Thank you for bringing this to my attention! I will make these changes right away.

jonbarrow avatar Jan 12 '18 15:01 jonbarrow

Ty!

I will implement a HTTP 429 error response on the backend, if the user will make too many requests for zip files. It is honestly rather a backend issue. I was just too lazy to edit the way zip downloads work

Tarnadas avatar Jan 12 '18 16:01 Tarnadas

Please also keep in mind, that cemu-smm has been updated to 3.x

Some API calls have changed

Tarnadas avatar Jan 12 '18 16:01 Tarnadas