html5 transcript exists - #9924
Conversation
|
jenkins run bokchoy |
73f0f3e to
c386011
Compare
|
@adampalay @waheedahmed @mushtaqak have a review ! |
There was a problem hiding this comment.
why old_metadata.get('html5_sources', [])? Why not old_metadata.get('html5_sources', False) or just old_metadata.get('html5_sources')
There was a problem hiding this comment.
ok will replace with old_metadata.get('html5_sources', False)
There was a problem hiding this comment.
html5_sources is a list and i prefer to set the default values accordingly.
There was a problem hiding this comment.
old_metadata.get('html5_sources') this is fine too.
There was a problem hiding this comment.
Can you shed some light on this self.sub, what's the purpose ?
There was a problem hiding this comment.
The purpose of self.sub is to check that there should transcript attached to video and then we will sure this this part of code will only run when there is already transcript present because we need transcript for copy or renaming with different htmls_id.
|
@muzaffaryousaf, @muhammad-ammar kindly review ! |
|
@muzaffaryousaf kindly review ! |
|
@Shrhawk Sure. I will take a look in early morning. |
There was a problem hiding this comment.
@Shrhawk Do we have unit test coverage for this newly added code, if not, can we add some unit tests ?
There was a problem hiding this comment.
NVM, i see you have added the tests.
There was a problem hiding this comment.
What if we get html5_sources from self/item instead of old_metadata because manage_video_subtitles_save uses item.html5_sources method instead of old_metadata to copy/rename, if values are different for both the result will be unexpected.
There was a problem hiding this comment.
The same call is happening in manage_video_subtitles_save method, it will be nice if we can reduce the call, somehow.
|
@Shrhawk I'm done with first pass, let me know when you are done with changes. |
|
@muzaffaryousaf i have make changes kindly review it ! |
There was a problem hiding this comment.
@adampalay add both module-stores as you suggested !
|
@Shrhawk , looks like you need to address 3 quality violations: Otherwise, this looks good. |
There was a problem hiding this comment.
@Shrhawk getattr(self, 'html5_sources') will raise AttributeError if self don't have html5_sources attribute.
https://docs.python.org/2/library/functions.html#getattr
|
@Shrhawk 👍 Good to go once you fix the quality issue and one inline comment & don't forget to squash the commits. Thanks. |
|
@adampalay done thumps up ? |
1587512 to
378b332
Compare
There was a problem hiding this comment.
since [] if falsey, you should instead use hasattr(self, 'html5_sources'). Then in the next line, you don't need to use getattr.
340a02b to
f92a766
Compare
There was a problem hiding this comment.
you've already checked that self has html5_sources, so you don't need getattr here
|
not sure why tests failed... |
|
jenkins run python |
|
jenkins run bokchoy |
|
@adampalay tests are passing now !! |
TNL-3168
Steps to Reproduce:
1.Create a video component with youtube and html(mp4) url
2.Save the component
3.Edit the component and click import from youtube(transcript)
4.Go to assets page of an course (transcript with youtube_id only)
Problem:
editor_saved is not syncing subs for an edge case above.
Solution:
At editor_saved check if
youtube_subalready exists and there is nohtml5_subspresent for html5_resources then create newhtml5_subs.