Added WavPack support. fixes #195

This commit is contained in:
emeric
2022-01-31 20:18:41 +01:00
parent 644903bc02
commit 24d239f1e7
6 changed files with 24 additions and 19 deletions
-1
View File
@@ -119,7 +119,6 @@ Transcoder::start()
args.emplace_back("-b:a");
args.emplace_back(std::to_string(_parameters.bitrate));
// Codecs and formats
switch (_parameters.format)
{
+9 -10
View File
@@ -24,16 +24,15 @@
#include "Types.hpp"
namespace Av {
struct TranscodeParameters
namespace Av
{
Format format;
std::size_t bitrate {128000};
std::optional<std::size_t> stream; // Id of the stream to be transcoded (auto detect by default)
std::chrono::milliseconds offset {0};
bool stripMetadata {true};
};
struct TranscodeParameters
{
Format format;
std::size_t bitrate {128000};
std::optional<std::size_t> stream; // Id of the stream to be transcoded (auto detect by default)
std::chrono::milliseconds offset {0};
bool stripMetadata {true};
};
} // namespace Av
+5 -6
View File
@@ -33,12 +33,11 @@ namespace Av {
enum class Format
{
// Values are important and must not be changed (stored in the UI's localstorage)
MP3 = 0,
OGG_OPUS = 1,
MATROSKA_OPUS = 2,
OGG_VORBIS = 3,
WEBM_VORBIS = 4,
MP3,
OGG_OPUS,
MATROSKA_OPUS,
OGG_VORBIS,
WEBM_VORBIS,
};
std::string_view formatToMimetype(Format format);
@@ -542,6 +542,13 @@ CREATE TABLE "listen" (
migrateListens("__scrobbler_listenbrainz_history__", Scrobbler::ListenBrainz);
}
static
void
migrateFromV32(Session& session)
{
ScanSettings::get(session).modify()->addAudioFileExtension(".wv");
}
void
doDbMigration(Session& session)
{
@@ -580,6 +587,7 @@ CREATE TABLE "listen" (
{29, migrateFromV29},
{30, migrateFromV30},
{31, migrateFromV31},
{32, migrateFromV32},
};
while (1)
@@ -26,7 +26,7 @@ namespace Database
class Session;
using Version = std::size_t;
static constexpr Version LMS_DATABASE_VERSION {32};
static constexpr Version LMS_DATABASE_VERSION {33};
class VersionInfo
{
public:
@@ -94,7 +94,7 @@ class ScanSettings : public Object<ScanSettings, ScanSettingsId>
Wt::WTime _startTime = Wt::WTime {0,0,0};
UpdatePeriod _updatePeriod {UpdatePeriod::Never};
RecommendationEngineType _recommendationEngineType {RecommendationEngineType::Clusters};
std::string _audioFileExtensions {".alac .mp3 .ogg .oga .aac .m4a .m4b .flac .wav .wma .aif .aiff .ape .mpc .shn .opus"};
std::string _audioFileExtensions {".alac .mp3 .ogg .oga .aac .m4a .m4b .flac .wav .wma .aif .aiff .ape .mpc .shn .opus .wv"};
Wt::Dbo::collection<Wt::Dbo::ptr<ClusterType>> _clusterTypes;
};