Add a hint for files that are going to be transcoded. ref #53
This commit is contained in:
@@ -263,6 +263,22 @@ getTrackPath(const Track::pointer& track)
|
||||
return path;
|
||||
}
|
||||
|
||||
static
|
||||
std::string_view
|
||||
formatToSuffix(AudioFormat format)
|
||||
{
|
||||
switch (format)
|
||||
{
|
||||
case AudioFormat::MP3: return "mp3";
|
||||
case AudioFormat::OGG_OPUS: return "opus";
|
||||
case AudioFormat::MATROSKA_OPUS: return "mka";
|
||||
case AudioFormat::OGG_VORBIS: return "ogg";
|
||||
case AudioFormat::WEBM_VORBIS: return "webm";
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
static
|
||||
Response::Node
|
||||
trackToResponseNode(const Track::pointer& track, Session& dbSession, const User::pointer& user)
|
||||
@@ -293,6 +309,9 @@ trackToResponseNode(const Track::pointer& track, Session& dbSession, const User:
|
||||
trackResponse.setAttribute("suffix", extension.string().substr(1));
|
||||
}
|
||||
|
||||
if (user->getSubsonicTranscodeEnable())
|
||||
trackResponse.setAttribute("transcodeSuffix", formatToSuffix(user->getSubsonicTranscodeFormat()));
|
||||
|
||||
trackResponse.setAttribute("coverArt", IdToString({Id::Type::Track, track.id()}));
|
||||
|
||||
auto artists {track->getArtists()};
|
||||
|
||||
Reference in New Issue
Block a user