Added M4B file support
This commit is contained in:
@@ -69,6 +69,12 @@ ScanSettings::getAudioFileExtensions() const
|
||||
return std::set<std::filesystem::path>(std::cbegin(extensions), std::cend(extensions));
|
||||
}
|
||||
|
||||
void
|
||||
ScanSettings::addAudioFileExtension(const std::filesystem::path& ext)
|
||||
{
|
||||
_audioFileExtensions += " " + ext.string();
|
||||
}
|
||||
|
||||
std::vector<ClusterType::pointer>
|
||||
ScanSettings::getClusterTypes() const
|
||||
{
|
||||
@@ -76,7 +82,7 @@ ScanSettings::getClusterTypes() const
|
||||
}
|
||||
|
||||
void
|
||||
ScanSettings::setMediaDirectory(std::filesystem::path p)
|
||||
ScanSettings::setMediaDirectory(const std::filesystem::path& p)
|
||||
{
|
||||
_mediaDirectory = stringTrimEnd(p.string(), "/\\");
|
||||
}
|
||||
|
||||
@@ -63,7 +63,8 @@ class ScanSettings : public Wt::Dbo::Dbo<ScanSettings>
|
||||
SimilarityEngineType getSimilarityEngineType() const { return _similarityEngineType; }
|
||||
|
||||
// Setters
|
||||
void setMediaDirectory(std::filesystem::path p);
|
||||
void addAudioFileExtension(const std::filesystem::path& ext);
|
||||
void setMediaDirectory(const std::filesystem::path& p);
|
||||
void setUpdateStartTime(Wt::WTime t) { _startTime = t; }
|
||||
void setUpdatePeriod(UpdatePeriod p) { _updatePeriod = p; }
|
||||
void setClusterTypes(Session& session, const std::set<std::string>& clusterTypeNames);
|
||||
@@ -89,7 +90,7 @@ class ScanSettings : public Wt::Dbo::Dbo<ScanSettings>
|
||||
Wt::WTime _startTime = Wt::WTime {0,0,0};
|
||||
UpdatePeriod _updatePeriod {UpdatePeriod::Never};
|
||||
SimilarityEngineType _similarityEngineType {SimilarityEngineType::Clusters};
|
||||
std::string _audioFileExtensions {".mp3 .ogg .oga .aac .m4a .flac .wav .wma .aif .aiff .ape .mpc .shn .opus"};
|
||||
std::string _audioFileExtensions {".mp3 .ogg .oga .aac .m4a .m4b .flac .wav .wma .aif .aiff .ape .mpc .shn .opus"};
|
||||
Wt::Dbo::collection<Wt::Dbo::ptr<ClusterType>> _clusterTypes;
|
||||
};
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
namespace Database {
|
||||
|
||||
#define LMS_DATABASE_VERSION 10
|
||||
#define LMS_DATABASE_VERSION 11
|
||||
|
||||
using Version = std::size_t;
|
||||
|
||||
@@ -140,6 +140,10 @@ CREATE TABLE IF NOT EXISTS "track_bookmark" (
|
||||
constraint "fk_track_bookmark_user" foreign key ("user_id") references "user" ("id") on delete cascade deferrable initially deferred
|
||||
);)");
|
||||
}
|
||||
else if (version == 10)
|
||||
{
|
||||
ScanSettings::get(*this).modify()->addAudioFileExtension(".m4b");
|
||||
}
|
||||
else
|
||||
{
|
||||
LMS_LOG(DB, ERROR) << "Database version " << version << " cannot be handled using migration";
|
||||
|
||||
Reference in New Issue
Block a user