Skip to content

Commit b17b564

Browse files
feat: ✨ improve subsonic search compatibility by adding parent and created fields
1 parent 7ecacf2 commit b17b564

3 files changed

Lines changed: 2 additions & 2 deletions

File tree

handlers.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ func ProxyPlaylistOrQueue(cfg *Config, rp http.Handler, permanent bool) http.Han
162162
json.NewEncoder(w).Encode(resp)
163163
return
164164
}
165-
166165
rp.ServeHTTP(w, r)
167166
}
168167
}

itunes.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ func WrapExternalSearch(items []ExternalItem) map[string]any {
118118
songs := make([]map[string]any, len(items))
119119
for i, item := range items {
120120
songs[i] = map[string]any{
121+
"parent": item.Album,
121122
"id": "itunes-" + item.RecordingID,
122123
"title": item.Title,
123124
"artist": item.Artist,
@@ -131,6 +132,7 @@ func WrapExternalSearch(items []ExternalItem) map[string]any {
131132
"contentType": "audio/mpeg",
132133
"transcodedSuffix": "mp3",
133134
"transcodedContentType": "audio/mpeg",
135+
"created": time.Now(),
134136
}
135137
}
136138

main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ func CORSMiddleware(next http.Handler) http.Handler {
3232
}
3333

3434
func LoadConfig() (*Config, error) {
35-
// Load .env file if it exists
3635
if err := godotenv.Load(); err != nil {
3736
log.Println("No .env file found or error loading it")
3837
}

0 commit comments

Comments
 (0)