owickstrom / komposition

The video editor built for screencasters
https://owickstrom.github.io/komposition/
Mozilla Public License 2.0
429 stars 21 forks source link

Make proxy media filenames content-adressable #76

Open Cmdv opened 5 years ago

Cmdv commented 5 years ago

Description:

This pull requests fixes #24

Make sure to describe (where applicable):

Checklist:

Please make sure to check the following items (that are applicable.)

How to test: import new video file and look at the command line output to see the naming of files should be as follows:

screenshot 2019-01-08 at 20 12 00

TODO: Testing instructions for reviewer. I split this functionality out into its own file as I was unsure where it could live. This is because the function could also be used with #72

Cmdv commented 5 years ago

I may need tips regards to how I would write a test for this, I was thinking literally making sure calling the function twice with the same name returns different SHAs? 😸

Cmdv commented 5 years ago

I ended up working it out, but I'm unsure if that single test is enough it just makes sure calling the function twice returns different SHAs

Cmdv commented 5 years ago

Ah ok so is it a case of just removing this randomising part of the function?

owickstrom commented 5 years ago

Removing the randomness and using file contents, rather than file name, as the hash input.

Cmdv commented 5 years ago

@owickstrom I've tried to research how to Hash a file content in Haskell, but I'm not aquatentced on the subject overall so not been able to work out what needs to be done.

If you have any pointers that would be great 👍

Cmdv commented 5 years ago

@owickstrom totally forgot I was doing this!! is this still a valid PR and if so did you have any idea into hashing a file with Haskell?

owickstrom commented 5 years ago

Hey @Cmdv! No worries, but feel free to pick this up again if you'd like. I don't have any pointers for you right now, but if I find some time I'll try to post some links.