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

Support processing video & audio #336

Merged
merged 10 commits into from
Oct 12, 2022
Merged

Support processing video & audio #336

merged 10 commits into from
Oct 12, 2022

Conversation

MrOrz
Copy link
Member

@MrOrz MrOrz commented Oct 6, 2022

Implements video & audio processing

  • Implementation processMedia() is as proposed in https://g0v.hackmd.io/IqCOZMZLRe-JPMSJIV3yRQ#Audio-amp-Video
  • Add unit test
  • Log proxied file size to see how much over-sized files are there
    • Video on LINE can be huge (>50MB), which takes more than 1 minute to download, so that Cloudflare will prematurely cut off the response of rumors-api
    • We first record the possible size of these videos and see how we should adapt (maybe process video in job queues in rumors-api)
  • Display video / audio in text (thumbnail not implemented yet) in Viewed Articles & Article Detail LIFF

Revamp: Fix Error: node_redis: The SET command contains a invalid argument type of "undefined".

  • Currently identical image / media article fast-forward mechanism will trigger the following error:
  • This is because we return choosingArticle() in processImage() & processMedia(), but the return signature is not compatible.
  • This commit reorganizes the return value of choosingArticle() in processImage() and processMedia() so that it works

Submitting new video

image

Found in database

image

Viewed article LIFF

image

image

![image](https://user-images.githubusercontent.com/108608/194580491-7a2ceabd-ee75-4f1d-9046-90ec9ac871d3.png)

Article detail LIFF

localhost_6006__path=_story_card-articlecard--video
image
image

@coveralls
Copy link

coveralls commented Oct 6, 2022

Pull Request Test Coverage Report for Build 3205846486

  • 20 of 22 (90.91%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.06%) to 91.65%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/webhook/index.js 1 3 33.33%
Totals Coverage Status
Change from base Build 3196229561: 0.06%
Covered Lines: 951
Relevant Lines: 1018

💛 - Coveralls

Currently identical image / media article fast-forward mechanism will trigger the following error:
Error: node_redis: The SET command contains a invalid argument type of "undefined".
This is because we return choosingArticle() in processImage & processMedia, but the return signature is not compatible.
This commit reorganizes the return value of choosingArticle() in processImage() and processMedia() so that it works.
@MrOrz MrOrz requested a review from andyy0216 October 7, 2022 14:56
@MrOrz MrOrz marked this pull request as ready for review October 7, 2022 23:54
@MrOrz MrOrz merged commit 61c8b7f into master Oct 12, 2022
@MrOrz MrOrz deleted the media-type branch October 12, 2022 15:17
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants