the-adirondacks-project / crik-server

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Discuss API design for files #7

Open JacobLeach opened 6 years ago

JacobLeach commented 6 years ago

Videos have files. Video libraries have files. Files have ids. It feels like you need to be able to GET /videos/:videoId/files as well as GET /video_libraries/:videoLibraryId/files but also GET /files/. Should we let people do GET /videos/:videoId/files/:fileId or should we restrict that endpoint (and the one of video libraries) to just get all?

CC: @travisby

travisby commented 6 years ago

I'm confused. Why do videos have multiple files? Is that just if I have one video split in multiple parts? (I picture back-in-the-day of ripping DVDs, or how "part 1/part 2" used to be a thing on youtube).

With that in mind, is each one really a "video?" Can we make video the abstraction that is the culmination of all files that are part of that logical viewing?

Then a library contains videos, and a video contains files. I think that feels like a pretty clean abstraction.

Is there any benefit to a user only getting one of the files in a video? The only one I can think of is "I don't want to redownload this whole fucking thing and I only need to see the last minute of it" - we can solve that by having the user pass in a timestamp or offset or something to the API, and the server can determine which file(s) to send.

Did what I say make sense? I'm not sure I grokked what you were proposing so I responded to what I thought you were proposing.

JacobLeach commented 6 years ago

I was thinking having multiple encodings of the same video one in low def and one in high def. I wanted people to be able to have both a 4K and a like 720p source file so they can watch one while local and the smaller one while on the road. Thus multiple video files per video and either is correct. I wanted libraries to hold files since a library is basically just a place to go find files (most likely a folder). You might split up your folders in HD and SD so we would need to know which folder had which so we could go stream it for the user.