Open wenkaizheng opened 4 years ago
or do i just keep the old file and do not download the new one?
Also what is other use case for updating video except change the name of file?
or do i just keep the old file and do not download the new one?
The best way would be merely renaming the Data chunks in the DB. So, if the user changed the name of a video file which is already inserted to the DB, you can iterate its Data chunks and update their names, accordingly. This way we will not go through the heavy-loaded encoding process again.
Also what is other use case for updating video except change the name of file?
At the moment, we can assume that is the only modification that end-users are allowed to do.
How to access the Data chunks in DB? when i run ./driver.sh video.mp4, the drivers script chunk the video.mp4 to many different files, for example a.mp4,b, b.mp4, and c.mp4. How should i deal with those files?
The data chunks of a given video file fall under the same name prefix, say the name of the video is test_video
and the name prefix of our service is /ndn/web/video
, then all Data chunks of that video will have a prefix like:
/ndn/web/video/test_video/...
.
What you need to do is finding all such Data chunks in the DB (by using a regex, probably) and rename them. Say the new name of the video is /test_video_modified
then all the Data chunks should have the following name pattern:
/ndn/web/video/test_video_modified/...
.
Find all such Data chunks in DB. do you mean query in DB? I think i am confused about what does DB look like and how to play with it.
Find all such Data chunks in DB. do you mean query in DB?
Yes
I think i am confused about what does DB look like and how to play with it.
Look at this: https://github.com/chavoosh/ndn-mongo-fileserver/tree/master/src/util
If the user just change the name of file, can i just delete the previous and download the new one even they are the same video?