Do not merge this yet, it still needs some work!--> See update
Refering to #15 the program currently tries to create new ES-nodes for every harvested episode and series, no matter if it is already existent or not. This leads to errors after making unsuccessful POST-requests and prevents the program from saving the corresponding IDs of those nodes.
I propose to solve this, by:
checking if there is already a folder in ES for the corresponding OC instance.
if so, fetch all child nodes including metadata
in src/edu-sharing/create-folders-structure.js check before each request, if the directory already exists -> if so save node ID
in src/edu-sharing/create-children.js check before each request, if the episode already exists
This PR adds the possibility to fetch all relevant, existing nodes and currently filters them by type (only folders are kept).
So 1-3 is mostly done.
The check still needs to be implemented for the episodes.
We should also discuss, if it makes sense to serialize the fetched data.
Update
Implemented 1-3. Instead of step 4, the programm now tries to create a node for each episode by sending a POST request. If a node with the same filename already exists, it will be skipped and the next one is tried. For future updates, we should target to map the opencast id's to the edusharing nodes, so we can handle deleted nodes or nodes with duplicate names.
This PR should also fix #24, so we can now delete our local storage files and/or the files in Edusharing and the programm will synch/refresh all missing nodes.
Do not merge this yet, it still needs some work!--> See updateRefering to #15 the program currently tries to create new ES-nodes for every harvested episode and series, no matter if it is already existent or not. This leads to errors after making unsuccessful POST-requests and prevents the program from saving the corresponding IDs of those nodes.
I propose to solve this, by:
src/edu-sharing/create-folders-structure.js
check before each request, if the directory already exists -> if so save node IDsrc/edu-sharing/create-children.js
check before each request, if the episode already existsThis PR adds the possibility to fetch all relevant, existing nodes and currently filters them by type (only folders are kept). So 1-3 is mostly done. The check still needs to be implemented for the episodes.
We should also discuss, if it makes sense to serialize the fetched data.
Update
Implemented 1-3. Instead of step 4, the programm now tries to create a node for each episode by sending a POST request. If a node with the same filename already exists, it will be skipped and the next one is tried. For future updates, we should target to map the opencast id's to the edusharing nodes, so we can handle deleted nodes or nodes with duplicate names.
This PR should also fix #24, so we can now delete our local storage files and/or the files in Edusharing and the programm will synch/refresh all missing nodes.