docs(api): document intentional audioContentType divergence from subsonic
This commit is contained in:
@@ -107,6 +107,7 @@ func seedTrackWithFile(t *testing.T, pool *pgxpool.Pool, albumID, artistID pgtyp
|
||||
ArtistID: artistID,
|
||||
TrackNumber: &one,
|
||||
DiscNumber: nil,
|
||||
// DurationMs: arbitrary non-zero; tests don't assert on it.
|
||||
DurationMs: int32(len(fileBody)),
|
||||
FilePath: path,
|
||||
FileSize: int64(len(fileBody)),
|
||||
|
||||
@@ -57,6 +57,12 @@ func resolveAlbumCoverPath(ctx context.Context, q *dbq.Queries, album dbq.Album)
|
||||
// ogg, opus, m4a, aac, wav) to a MIME type for the Content-Type header.
|
||||
// Unknown formats fall back to octet-stream so the browser downloads them
|
||||
// rather than attempting to decode.
|
||||
//
|
||||
// Divergences from internal/subsonic/types.go's contentTypeForFormat are
|
||||
// intentional: opus→audio/ogg (library .opus files are Ogg-encapsulated, so
|
||||
// this matches real library contents), aac→audio/aac (raw AAC is ADTS, not
|
||||
// MP4, so audio/mp4 would mislead codec sniffers), and there is no "oga" case
|
||||
// (we don't record that format). Don't "fix" these to match subsonic.
|
||||
func audioContentType(format string) string {
|
||||
switch strings.ToLower(format) {
|
||||
case "mp3":
|
||||
|
||||
Reference in New Issue
Block a user