From 16fc4eb7926c43935271cb95e17eeb0d5c74d2fe Mon Sep 17 00:00:00 2001
From: Deluan <deluan@deluan.com>
Date: Tue, 21 Mar 2023 10:31:00 -0400
Subject: [PATCH] Fix missing extensions in Share downloads.

See https://github.com/navidrome/navidrome/pull/2246#issuecomment-1476996397
---
 core/archiver.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/archiver.go b/core/archiver.go
index cc1621de4..f0b0f47e5 100644
--- a/core/archiver.go
+++ b/core/archiver.go
@@ -127,7 +127,7 @@ func (a *archiver) zipMediaFiles(ctx context.Context, id string, format string,
 
 func (a *archiver) playlistFilename(mf model.MediaFile, format string, idx int) string {
 	ext := mf.Suffix
-	if format != "raw" {
+	if format != "" && format != "raw" {
 		ext = format
 	}
 	file := fmt.Sprintf("%02d - %s - %s.%s", idx+1, mf.Artist, mf.Title, ext)