Added dsf files support, fixes #449
This commit is contained in:
+17
-5
@@ -30,7 +30,7 @@ ARG BUILD_PACKAGES=" \
|
|||||||
boost-dev \
|
boost-dev \
|
||||||
libarchive-dev \
|
libarchive-dev \
|
||||||
libconfig-dev \
|
libconfig-dev \
|
||||||
taglib-dev \
|
utfcpp \
|
||||||
sqlite-dev \
|
sqlite-dev \
|
||||||
gtest-dev"
|
gtest-dev"
|
||||||
|
|
||||||
@@ -67,9 +67,9 @@ RUN \
|
|||||||
--enable-libopus \
|
--enable-libopus \
|
||||||
--enable-libvorbis \
|
--enable-libvorbis \
|
||||||
--disable-everything \
|
--disable-everything \
|
||||||
--enable-decoder=aac*,ac3*,alac,als,flac,mp3*,libopus,pcm*,libvorbis,wavpack,wma*,libopenjpg,png \
|
--enable-decoder=aac*,ac3*,alac,als,dsd*,flac,mp3*,libopus,pcm*,libvorbis,wavpack,wma*,libopenjpg,png \
|
||||||
--enable-encoder=libmp3lame,libopus,libvorbis \
|
--enable-encoder=libmp3lame,libopus,libvorbis \
|
||||||
--enable-demuxer=aac,aiff,asf,flac,ipod,ogg,matroska,mov,mp3,mp4,wav,wv,webm \
|
--enable-demuxer=aac,aiff,asf,dsf,flac,ipod,ogg,matroska,mov,mp3,mp4,wav,wv,webm \
|
||||||
--enable-muxer=ogg,matroska,mp3,webm \
|
--enable-muxer=ogg,matroska,mp3,webm \
|
||||||
--enable-protocol=file,pipe \
|
--enable-protocol=file,pipe \
|
||||||
--enable-filter=aresample \
|
--enable-filter=aresample \
|
||||||
@@ -100,6 +100,19 @@ RUN \
|
|||||||
mkdir -p ${PREFIX}/include/stb && \
|
mkdir -p ${PREFIX}/include/stb && \
|
||||||
cp ./*.h ${PREFIX}/include/stb
|
cp ./*.h ${PREFIX}/include/stb
|
||||||
|
|
||||||
|
# TAGLIB
|
||||||
|
ARG TAGLIB_VERSION=v2.0.1
|
||||||
|
RUN \
|
||||||
|
DIR=/tmp/taglib && mkdir -p ${DIR} && cd ${DIR} && \
|
||||||
|
curl -sLO https://github.com/taglib/taglib/archive/${TAGLIB_VERSION}.tar.gz && \
|
||||||
|
tar -x --strip-components=1 -f ${TAGLIB_VERSION}.tar.gz
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
DIR=/tmp/taglib && mkdir -p ${DIR} && cd ${DIR} && \
|
||||||
|
CXXFLAGS="-I/usr/include/utf8cpp" cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${PREFIX} -DBUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF -DBUILD_BINDINGS=OFF -DBUILD_TESTING=OFF -DTRACE_IN_RELEASE=OFF -DWITH_ZLIB=ON && \
|
||||||
|
make -j$(nproc) && \
|
||||||
|
make install
|
||||||
|
|
||||||
# LMS
|
# LMS
|
||||||
COPY . /tmp/lms/
|
COPY . /tmp/lms/
|
||||||
RUN \
|
RUN \
|
||||||
@@ -154,8 +167,7 @@ ARG RUNTIME_PACKAGES=" \
|
|||||||
boost-thread \
|
boost-thread \
|
||||||
libarchive \
|
libarchive \
|
||||||
libconfig++ \
|
libconfig++ \
|
||||||
sqlite-libs \
|
sqlite-libs"
|
||||||
taglib"
|
|
||||||
|
|
||||||
ARG LMS_USER=lms
|
ARG LMS_USER=lms
|
||||||
ARG LMS_GROUP=lms
|
ARG LMS_GROUP=lms
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace lms::db
|
|||||||
{
|
{
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
static constexpr Version LMS_DATABASE_VERSION{ 58 };
|
static constexpr Version LMS_DATABASE_VERSION{ 59 };
|
||||||
}
|
}
|
||||||
|
|
||||||
VersionInfo::VersionInfo()
|
VersionInfo::VersionInfo()
|
||||||
@@ -466,6 +466,12 @@ SELECT
|
|||||||
session.getDboSession()->execute("DROP INDEX cluster_name_idx");
|
session.getDboSession()->execute("DROP INDEX cluster_name_idx");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void migrateFromV58(Session& session)
|
||||||
|
{
|
||||||
|
// DSF support
|
||||||
|
session.getDboSession()->execute("UPDATE scan_settings SET audio_file_extensions = audio_file_extensions || ' .dsf'");
|
||||||
|
}
|
||||||
|
|
||||||
bool doDbMigration(Session& session)
|
bool doDbMigration(Session& session)
|
||||||
{
|
{
|
||||||
static const std::string outdatedMsg{ "Outdated database, please rebuild it (delete the .db file and restart)" };
|
static const std::string outdatedMsg{ "Outdated database, please rebuild it (delete the .db file and restart)" };
|
||||||
@@ -501,6 +507,7 @@ SELECT
|
|||||||
{55, migrateFromV55},
|
{55, migrateFromV55},
|
||||||
{56, migrateFromV56},
|
{56, migrateFromV56},
|
||||||
{57, migrateFromV57},
|
{57, migrateFromV57},
|
||||||
|
{58, migrateFromV58},
|
||||||
};
|
};
|
||||||
|
|
||||||
bool migrationPerformed{};
|
bool migrationPerformed{};
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ namespace lms::db
|
|||||||
Wt::WTime _startTime = Wt::WTime{ 0,0,0 };
|
Wt::WTime _startTime = Wt::WTime{ 0,0,0 };
|
||||||
UpdatePeriod _updatePeriod{ UpdatePeriod::Never };
|
UpdatePeriod _updatePeriod{ UpdatePeriod::Never };
|
||||||
SimilarityEngineType _similarityEngineType{ SimilarityEngineType::Clusters };
|
SimilarityEngineType _similarityEngineType{ SimilarityEngineType::Clusters };
|
||||||
std::string _audioFileExtensions{ ".alac .mp3 .ogg .oga .aac .m4a .m4b .flac .wav .wma .aif .aiff .ape .mpc .shn .opus .wv" };
|
std::string _audioFileExtensions{ ".alac .mp3 .ogg .oga .aac .m4a .m4b .flac .wav .wma .aif .aiff .ape .mpc .shn .opus .wv .dsf" };
|
||||||
std::string _extraTagsToScan;
|
std::string _extraTagsToScan;
|
||||||
std::string _artistTagDelimiters;
|
std::string _artistTagDelimiters;
|
||||||
std::string _defaultTagDelimiters;
|
std::string _defaultTagDelimiters;
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
#include <taglib/apeproperties.h>
|
#include <taglib/apeproperties.h>
|
||||||
#include <taglib/apetag.h>
|
#include <taglib/apetag.h>
|
||||||
#include <taglib/asffile.h>
|
#include <taglib/asffile.h>
|
||||||
|
#if TAGLIB_MAJOR_VERSION >= 2
|
||||||
|
#include <taglib/dsffile.h>
|
||||||
|
#endif
|
||||||
#include <taglib/id3v2tag.h>
|
#include <taglib/id3v2tag.h>
|
||||||
#include <taglib/fileref.h>
|
#include <taglib/fileref.h>
|
||||||
#include <taglib/flacfile.h>
|
#include <taglib/flacfile.h>
|
||||||
@@ -328,6 +331,10 @@ namespace lms::metadata
|
|||||||
_audioProperties.bitsPerSample = mp4Properties->bitsPerSample();
|
_audioProperties.bitsPerSample = mp4Properties->bitsPerSample();
|
||||||
else if (const auto * wavePackProperties{ dynamic_cast<const TagLib::WavPack::Properties*>(properties) })
|
else if (const auto * wavePackProperties{ dynamic_cast<const TagLib::WavPack::Properties*>(properties) })
|
||||||
_audioProperties.bitsPerSample = wavePackProperties->bitsPerSample();
|
_audioProperties.bitsPerSample = wavePackProperties->bitsPerSample();
|
||||||
|
#if TAGLIB_MAJOR_VERSION >= 2
|
||||||
|
else if (const auto * dsfProperties{ dynamic_cast<const TagLib::DSF::Properties*>(properties) })
|
||||||
|
_audioProperties.bitsPerSample = dsfProperties->bitsPerSample();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void TagLibTagReader::visitTagValues(TagType tag, TagValueVisitor visitor) const
|
void TagLibTagReader::visitTagValues(TagType tag, TagValueVisitor visitor) const
|
||||||
|
|||||||
Reference in New Issue
Block a user