feat(subsonic): return transcoded mime and transcoded suffix in subsonic responses
fixes #106 * Added support to TranscodedContentType and TranscodedSuffix * Make sure that we have a profile * Fix linting * Fixed use of NewTCTrackByFolder instead of NewTrackByTags in handlers_by_tags.go simplify a bit
This commit is contained in:
@@ -43,6 +43,18 @@ func streamGetTransPref(dbc *db.DB, userID int, client string) (*db.TranscodePre
|
||||
return &pref, nil
|
||||
}
|
||||
|
||||
func streamGetTransPrefProfile(dbc *db.DB, userID int, client string) (mime string, suffix string) {
|
||||
pref, _ := streamGetTransPref(dbc, userID, client)
|
||||
if pref == nil {
|
||||
return "", ""
|
||||
}
|
||||
profile, ok := transcode.UserProfiles[pref.Profile]
|
||||
if !ok {
|
||||
return "", ""
|
||||
}
|
||||
return profile.MIME(), profile.Suffix()
|
||||
}
|
||||
|
||||
var errUnknownMediaType = fmt.Errorf("media type is unknown")
|
||||
|
||||
// TODO: there is a mismatch between abs paths for podcasts and music. if they were the same, db.AudioFile
|
||||
|
||||
Reference in New Issue
Block a user