Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognize video files as non-generic assets #922

Merged
merged 3 commits into from
Mar 11, 2022
Merged

Recognize video files as non-generic assets #922

merged 3 commits into from
Mar 11, 2022

Conversation

jwodder
Copy link
Member

@jwodder jwodder commented Feb 22, 2022

Closes #920.

@jwodder jwodder added the minor Increment the minor version when merged label Feb 22, 2022
@codecov
Copy link

codecov bot commented Feb 22, 2022

Codecov Report

Merging #922 (cb160b6) into master (e8c71aa) will decrease coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #922      +/-   ##
==========================================
- Coverage   87.41%   87.31%   -0.10%     
==========================================
  Files          61       62       +1     
  Lines        7454     7665     +211     
==========================================
+ Hits         6516     6693     +177     
- Misses        938      972      +34     
Flag Coverage Δ
unittests 87.31% <100.00%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
dandi/files.py 79.44% <100.00%> (-3.49%) ⬇️
dandi/tests/test_files.py 100.00% <100.00%> (ø)
dandi/misctypes.py 61.68% <0.00%> (-0.94%) ⬇️
dandi/download.py 86.94% <0.00%> (-0.52%) ⬇️
dandi/support/digests.py 100.00% <0.00%> (ø)
dandi/tests/test_delete.py 100.00% <0.00%> (ø)
dandi/tests/test_upload.py 100.00% <0.00%> (ø)
dandi/tests/test_dandiapi.py 100.00% <0.00%> (ø)
dandi/support/tests/test_digests.py 100.00% <0.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e8c71aa...cb160b6. Read the comment docs.

@Saksham20
Copy link
Contributor

@jwodder, @yarikoptic is this good to go?

@yarikoptic
Copy link
Member

@jwodder -- is that all that is needed and PR just needs to be taken out of draft (although having some unittest tuned or added might be good) or there is more to do?

@jwodder
Copy link
Member Author

jwodder commented Mar 9, 2022

@yarikoptic You still need to answer my question in the issue: #920.

@jwodder jwodder marked this pull request as ready for review March 9, 2022 16:50
dandi/files.py Outdated
) -> BareAsset:
metadata = get_default_metadata(self.filepath, digest=digest)
metadata.path = self.path
return metadata
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not to move this implementation of get_metadata into LocalFileAsset to provide such default implementation and thus to avoid duplication across subclasses which just need to use the default?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could there be a test added which would ensure that upload does recognize video files as "first class citizen"?

Copy link
Member Author

@jwodder jwodder Mar 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_metadata: Done.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For testing, what about just checking here that files with one of more of the video extensions are recognized as Dandi files?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@yarikoptic
Copy link
Member

Thank you @jwodder, let's see where the changes would lead us ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add VIDEO_FILE_EXTENSIONS into the "default" set
3 participants