Sekai-World / sekai-viewer

Web Database Viewer of Project Sekai
https://sekai.best
GNU General Public License v3.0
333 stars 39 forks source link

[BUG] Short Version Music Download Trimmed #417

Closed atnqty closed 1 year ago

atnqty commented 1 year ago

Describe the bug

Short version of music downloaded have first nine seconds trimmed if "Skip beginning silence" was not toggled off in long version tab

To Reproduce

  1. Go to a music information page e.g. https://sekai.best/music/1
  2. Without toggling off 'Skip beginning silence' and keeping everything else in default, select 'Short version' for 'Type'
  3. Click the download button located in the music player below the
  4. Observe the length of downloaded mp3 file to be seconds short

Expected behavior

Since short version of music does not have leading silence, short version download should not be trimmed regardless of the state of the 'Skip beginning silence' toggle

Browser (please complete the following information):

Possible cause and/or solution

Add 'Long version' selected as a condition for trimming i.e. (not tested) vocalPreviewVal === "1" at https://github.com/Sekai-World/sekai-viewer/blob/7b94ffa270eda969a76cbc47409757e67dbdebf1/src/pages/music/MusicDetail.tsx#L398