mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-15 03:30:39 +03:00
Store uncompressed files in zip
This commit is contained in:
parent
2c370cae28
commit
9a1133601a
@ -44,7 +44,11 @@ func (a *archiver) Zip(ctx context.Context, id string, out io.Writer) error {
|
|||||||
|
|
||||||
func (a *archiver) addFileToZip(ctx context.Context, z *zip.Writer, mf model.MediaFile) error {
|
func (a *archiver) addFileToZip(ctx context.Context, z *zip.Writer, mf model.MediaFile) error {
|
||||||
_, file := filepath.Split(mf.Path)
|
_, file := filepath.Split(mf.Path)
|
||||||
w, err := z.Create(fmt.Sprintf("%s/%s", mf.Album, file))
|
w, err := z.CreateHeader(&zip.FileHeader{
|
||||||
|
Name: fmt.Sprintf("%s/%s", mf.Album, file),
|
||||||
|
Modified: mf.UpdatedAt,
|
||||||
|
Method: zip.Store,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(ctx, "Error creating zip entry", "file", mf.Path, err)
|
log.Error(ctx, "Error creating zip entry", "file", mf.Path, err)
|
||||||
return err
|
return err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user