...
 
Commits (967)
variables:
GIT_SUBMODULE_STRATEGY: normal
linux:
image: registry.videolan.org/medialibrary:20190531150343
tags:
- debian
- amd64
script:
- ./bootstrap
- ./configure --enable-tests
- make -j4
- make -j4 check
- ./unittest
- ./samples -vv
win32:
image: registry.videolan.org/medialibrary-win32:20190625083440
tags:
- win32
script:
- export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/prefix/lib/pkgconfig"
- ./bootstrap
- ./configure --enable-tests --host=i686-w64-mingw32 --disable-shared
- make -j4
- make -j4 check
- cp /prefix/dll/libvlc.dll .
- cp /prefix/dll/libvlccore.dll .
- ln -s /prefix/lib/vlc/plugins/ .
- wine unittest.exe
- wine samples.exe -vv
win64:
image: registry.videolan.org/medialibrary-win64:20190625085114
tags:
- win64
script:
- export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/prefix/lib/pkgconfig"
- ./bootstrap
- ./configure --enable-tests --host=x86_64-w64-mingw32 --disable-shared
- make -j4
- make -j4 check
- cp /prefix/dll/libvlc.dll .
- cp /prefix/dll/libvlccore.dll .
- ln -s /prefix/lib/vlc/plugins/ .
- wine unittest.exe
- wine samples.exe -vv
coverage:
image: registry.videolan.org/medialibrary:20190531150343
tags:
- debian
- amd64
only:
refs:
- master
script:
- ./bootstrap
- CXXFLAGS='--coverage -g -O0' LDFLAGS='--coverage -g -O0' ./configure --enable-tests
- make -j4 check
- ./unittest && ./samples
- lcov --capture --directory . -o coverage.info
- lcov --remove coverage.info "/usr/*" -o coverage.info
- lcov --remove coverage.info "/prefix/*" -o coverage.info
- lcov --remove coverage.info "$CI_PROJECT_DIR/test/*" -o coverage.info
- lcov --remove coverage.info "$CI_PROJECT_DIR/googletest/*" -o coverage.info
- lcov --remove coverage.info "$CI_PROJECT_DIR/src/logging/*" -o coverage.info
- lcov --remove coverage.info "$CI_PROJECT_DIR/libvlcpp/*" -o coverage.info
- lcov --summary coverage.info
- genhtml coverage.info --output-directory html/
artifacts:
name: "coverage-medialibrary-$CI_COMMIT_SHORT_SHA"
paths:
- html/
asan-ubsan:
image: registry.videolan.org/medialibrary:20190531150343
tags:
- debian
- amd64
variables:
LSAN_OPTIONS: 'detect_leaks=0'
script:
- ./bootstrap
- ./configure --enable-tests CXXFLAGS="-g -O1 -fsanitize=address,undefined"
- make -j4
- make -j4 check
- ./unittest
- ./samples -vv
ACLOCAL_AMFLAGS = -I m4
AM_CPPFLAGS = -Wall -Wsign-compare -Wextra -Wstrict-aliasing -Wstrict-overflow \
AM_CXXFLAGS = -Wall -Wsign-compare -Wextra -Wstrict-aliasing -Wstrict-overflow \
-Wformat=2 -Wno-unused-parameter -Wcast-align -Wpointer-arith \
-Wwrite-strings \
-pipe
......@@ -9,12 +9,14 @@ MEDIALIB_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)/src
libmedialibrary_ladir = $(includedir)/medialibrary
libmedialibrary_la_CXXFLAGS = \
$(AM_CXXFLAGS) \
-fvisibility=default \
$(NULL)
libmedialibrary_la_CPPFLAGS = \
$(MEDIALIB_CPPFLAGS) \
$(SQLITE_CFLAGS) \
$(VLC_CFLAGS) \
$(VLCPP_CFLAGS) \
-fvisibility=default \
$(NULL)
libmedialibrary_la_HEADERS = \
......@@ -22,9 +24,10 @@ libmedialibrary_la_HEADERS = \
include/medialibrary/IAlbumTrack.h \
include/medialibrary/IArtist.h \
include/medialibrary/IAudioTrack.h \
include/medialibrary/IBookmark.h \
include/medialibrary/IChapter.h \
include/medialibrary/IFile.h \
include/medialibrary/IGenre.h \
include/medialibrary/IHistoryEntry.h \
include/medialibrary/ILabel.h \
include/medialibrary/ILogger.h \
include/medialibrary/IMedia.h \
......@@ -37,6 +40,26 @@ libmedialibrary_la_HEADERS = \
include/medialibrary/Types.h \
include/medialibrary/IDeviceLister.h \
include/medialibrary/IFolder.h \
include/medialibrary/IQuery.h \
include/medialibrary/IMetadata.h \
include/medialibrary/ISubtitleTrack.h \
include/medialibrary/IThumbnailer.h \
include/medialibrary/IInterruptProbe.h \
$(NULL)
libmedialibraryfsdir = $(libmedialibrary_ladir)/filesystem
libmedialibraryfs_HEADERS = \
include/medialibrary/filesystem/IDevice.h \
include/medialibrary/filesystem/IDirectory.h \
include/medialibrary/filesystem/IFile.h \
include/medialibrary/filesystem/IFileSystemFactory.h \
$(NULL)
libmedialibraryparserdir = $(libmedialibrary_ladir)/parser
libmedialibraryparser_HEADERS = \
include/medialibrary/parser/IItem.h \
include/medialibrary/parser/Parser.h \
include/medialibrary/parser/IParserService.h \
$(NULL)
libmedialibrary_la_SOURCES = \
......@@ -47,9 +70,9 @@ libmedialibrary_la_SOURCES = \
src/Device.cpp \
src/Factory.cpp \
src/File.cpp \
src/Chapter.cpp \
src/Folder.cpp \
src/Genre.cpp \
src/History.cpp \
src/Label.cpp \
src/Media.cpp \
src/MediaLibrary.cpp \
......@@ -57,8 +80,11 @@ libmedialibrary_la_SOURCES = \
src/Playlist.cpp \
src/Settings.cpp \
src/Show.cpp \
src/Thumbnail.cpp \
src/ShowEpisode.cpp \
src/VideoTrack.cpp \
src/Metadata.cpp \
src/SubtitleTrack.cpp \
src/database/SqliteConnection.cpp \
src/database/SqliteTools.cpp \
src/database/SqliteTransaction.cpp \
......@@ -66,53 +92,31 @@ libmedialibrary_la_SOURCES = \
src/discoverer/FsDiscoverer.cpp \
src/discoverer/probe/PathProbe.cpp \
src/factory/FileSystemFactory.cpp \
src/factory/NetworkFileSystemFactory.cpp \
src/factory/DeviceListerFactory.cpp \
src/filesystem/common/CommonDevice.cpp \
src/filesystem/common/CommonFile.cpp \
src/filesystem/common/CommonDirectory.cpp \
src/filesystem/network/Directory.cpp \
src/filesystem/network/File.cpp \
src/filesystem/network/Device.cpp \
src/logging/IostreamLogger.cpp \
src/logging/Logger.cpp \
src/metadata_services/MetadataParser.cpp \
src/metadata_services/vlc/VLCMetadataService.cpp \
src/metadata_services/vlc/VLCThumbnailer.cpp \
src/metadata_services/LinkService.cpp \
src/thumbnails/ThumbnailerWorker.cpp \
src/parser/Parser.cpp \
src/parser/ParserService.cpp \
src/parser/ParserWorker.cpp \
src/parser/Task.cpp \
src/utils/Directory.cpp \
src/utils/Filename.cpp \
src/utils/ModificationsNotifier.cpp \
src/utils/Strings.cpp \
src/utils/Url.cpp \
src/utils/VLCInstance.cpp \
src/utils/File.cpp \
src/Bookmark.cpp \
$(NULL)
noinst_HEADERS = \
include/discoverer/IDiscoverer.h \
include/factory/IFileSystem.h \
include/filesystem/IDevice.h \
include/filesystem/IDirectory.h \
include/filesystem/IFile.h \
include/Fixup.h \
include/medialibrary/IAlbum.h \
include/medialibrary/IAlbumTrack.h \
include/medialibrary/IArtist.h \
include/medialibrary/IAudioTrack.h \
include/medialibrary/IFile.h \
include/medialibrary/IGenre.h \
include/medialibrary/IHistoryEntry.h \
include/medialibrary/ILabel.h \
include/medialibrary/ILogger.h \
include/medialibrary/IMedia.h \
include/medialibrary/IMediaLibrary.h \
include/medialibrary/IMovie.h \
include/medialibrary/IPlaylist.h \
include/medialibrary/IShowEpisode.h \
include/medialibrary/IShow.h \
include/medialibrary/IVideoTrack.h \
include/medialibrary/Types.h \
include/Types.h \
src/Album.h \
src/AlbumTrack.h \
......@@ -121,6 +125,7 @@ noinst_HEADERS = \
src/database/DatabaseHelpers.h \
src/database/SqliteConnection.h \
src/database/SqliteErrors.h \
src/database/SqliteQuery.h \
src/database/SqliteTools.h \
src/database/SqliteTraits.h \
src/database/SqliteTransaction.h \
......@@ -131,7 +136,6 @@ noinst_HEADERS = \
src/discoverer/probe/IProbe.h \
src/discoverer/probe/PathProbe.h \
src/factory/FileSystemFactory.h \
src/factory/NetworkFileSystemFactory.h \
src/factory/DeviceListerFactory.h \
src/File.h \
src/filesystem/common/CommonFile.h \
......@@ -141,43 +145,43 @@ noinst_HEADERS = \
src/filesystem/unix/Device.h \
src/filesystem/unix/Directory.h \
src/filesystem/unix/File.h \
src/filesystem/network/Device.h \
src/filesystem/network/Directory.h \
src/filesystem/network/File.h \
src/filesystem/unix/DeviceLister.h \
src/filesystem/win32/Directory.h \
src/filesystem/win32/File.h \
src/Chapter.h \
src/Folder.h \
src/Genre.h \
src/History.h \
src/Label.h \
src/logging/IostreamLogger.h \
src/logging/Logger.h \
src/Media.h \
src/MediaLibrary.h \
src/metadata_services/MetadataParser.h \
src/metadata_services/vlc/VLCMetadataService.h \
src/metadata_services/vlc/VLCThumbnailer.h \
src/metadata_services/vlc/imagecompressors/IImageCompressor.h \
src/metadata_services/LinkService.h \
src/thumbnails/ThumbnailerWorker.h \
src/Movie.h \
src/parser/Parser.h \
src/parser/ParserService.h \
src/parser/ParserWorker.h \
src/parser/Task.h \
src/Playlist.h \
src/Settings.h \
src/ShowEpisode.h \
src/Show.h \
src/utils/Cache.h \
src/Thumbnail.h \
src/utils/Directory.h \
src/utils/Filename.h \
src/utils/ModificationsNotifier.h \
src/utils/Strings.h \
src/utils/SWMRLock.h \
src/utils/Url.h \
src/utils/VLCInstance.h \
src/utils/File.h \
src/VideoTrack.h \
src/Metadata.h \
src/compat/Thread.h \
src/compat/Mutex.h \
src/compat/ConditionVariable.h \
src/SubtitleTrack.h \
src/Bookmark.h \
$(NULL)
......@@ -212,7 +216,6 @@ endif
libmedialibrary_la_LIBADD = \
$(SQLITE_LIBS) \
$(VLC_LIBS) \
$(NULL)
libmedialibrary_la_LDFLAGS = -no-undefined -export-symbols-regex 'NewMediaLibrary'
......@@ -221,25 +224,63 @@ libmedialibrary_la_LIBADD += libmedialibrary_macos.la
libmedialibrary_la_LDFLAGS += -Wl,-undefined,dynamic_lookup,-framework,Foundation
endif
lib_LTLIBRARIES = libmedialibrary.la
if HAVE_DARWIN
lib_LTLIBRARIES += libmedialibrary_macos.la
endif
if HAVE_LIBVLC
if HAVE_LIBVLC4
libmedialibrary_la_SOURCES += \
src/thumbnails/CoreThumbnailer.cpp \
src/thumbnails/CoreThumbnailer.h
if HAVE_EVAS
libmedialibrary_la_SOURCES += src/metadata_services/vlc/imagecompressors/EvasCompressor.cpp
noinst_HEADERS += src/metadata_services/vlc/imagecompressors/EvasCompressor.h
libmedialibrary_la_CPPFLAGS += $(EVAS_CFLAGS)
else
libmedialibrary_la_SOURCES += \
src/thumbnails/VmemThumbnailer.cpp \
src/thumbnails/VmemThumbnailer.h
if HAVE_LIBJPEG
libmedialibrary_la_SOURCES += src/metadata_services/vlc/imagecompressors/JpegCompressor.cpp
noinst_HEADERS += src/metadata_services/vlc/imagecompressors/JpegCompressor.h
libmedialibrary_la_SOURCES += src/thumbnails/imagecompressors/JpegCompressor.cpp
noinst_HEADERS += src/thumbnails/imagecompressors/JpegCompressor.h
libmedialibrary_la_CPPFLAGS += $(LIBJPEG_CFLAGS)
libmedialibrary_la_LIBADD += $(LIBJPEG_LIBS)
endif
endif
lib_LTLIBRARIES = libmedialibrary.la
if HAVE_DARWIN
lib_LTLIBRARIES += libmedialibrary_macos.la
libmedialibrary_la_SOURCES += \
src/metadata_services/vlc/VLCMetadataService.cpp \
src/metadata_services/vlc/Common.cpp \
src/utils/VLCInstance.cpp \
src/factory/NetworkFileSystemFactory.cpp \
src/filesystem/network/Directory.cpp \
src/filesystem/network/File.cpp \
src/filesystem/network/Device.cpp \
$(NULL)
noinst_HEADERS += \
src/utils/VLCInstance.h \
src/metadata_services/vlc/Common.hpp \
src/metadata_services/vlc/VLCMetadataService.h \
src/thumbnails/imagecompressors/IImageCompressor.h \
src/factory/NetworkFileSystemFactory.h \
src/filesystem/network/Device.h \
src/filesystem/network/Directory.h \
src/filesystem/network/File.h \
$(NULL)
libmedialibrary_la_CPPFLAGS += \
$(VLC_CFLAGS) \
$(VLCPP_CFLAGS) \
$(NULL)
libmedialibrary_la_LIBADD += $(VLC_LIBS)
endif
EXTRA_DIST=
if HAVE_TESTS
......@@ -255,20 +296,11 @@ libgtestmain_la_SOURCES = \
googletest/src/gtest_main.cc
libgtest_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I$(top_srcdir)/googletest \
-I$(top_srcdir)/googletest/include
if HAVE_PTHREAD
libgtest_la_CPPFLAGS += -DGTEST_HAS_PTHREAD=1
libgtest_la_CXXFLAGS = $(PTHREAD_CFLAGS)
libgtest_la_LIDADD = $(PTHREAD_LIBS)
else
libgtest_la_CPPFLAGS += -DGTEST_HAS_PTHREAD=0
endif
libgtestmain_la_CPPFLAGS = $(libgtest_la_CPPFLAGS)
libgtestmain_la_CXXFLAGS = $(libgtest_la_CXXFLAGS)
libgtestmain_la_LIBADD = $(libgtest_la_LIBADD)
libgtestmain_la_CPPFLAGS = $(AM_CPPFLAGS) $(libgtest_la_CPPFLAGS)
unittest_SOURCES = \
test/common/MediaLibraryTester.cpp \
......@@ -280,13 +312,13 @@ unittest_SOURCES = \
test/unittest/AlbumTrackTests.cpp \
test/unittest/ArtistTests.cpp \
test/unittest/AudioTrackTests.cpp \
test/unittest/ChapterTests.cpp \
test/unittest/DeviceTests.cpp \
test/unittest/FileTests.cpp \
test/unittest/FolderTests.cpp \
test/unittest/FsUtilsTests.cpp \
test/unittest/UrlTests.cpp \
test/unittest/GenreTests.cpp \
test/unittest/HistoryTests.cpp \
test/unittest/LabelTests.cpp \
test/unittest/MediaTests.cpp \
test/unittest/MovieTests.cpp \
......@@ -296,6 +328,9 @@ unittest_SOURCES = \
test/unittest/Tests.cpp \
test/unittest/VideoTrackTests.cpp \
test/unittest/MiscTests.cpp \
test/unittest/ThumbnailTests.cpp \
test/unittest/SubtitleTrackTests.cpp \
test/unittest/BookmarkTests.cpp \
$(NULL)
EXTRA_DIST += test/unittest/db_v3.sql
......@@ -305,16 +340,13 @@ unittest_CPPFLAGS = \
-DSRC_DIR=\"$(abs_srcdir)\" \
-I$(top_srcdir)/test \
-I$(top_srcdir)/googletest/include \
$(SQLITE_CFLAGS) \
$(VLCPP_CFLAGS) \
$(VLC_CFLAGS) \
$(libmedialibrary_la_CPPFLAGS) \
$(NULL)
unittest_LDADD = \
libmedialibrary.la \
libgtest.la \
libgtestmain.la \
$(PTHREAD_LIBS) \
$(SQLITE_LIBS) \
$(NULL)
......@@ -329,24 +361,69 @@ samples_CPPFLAGS = \
-DSRC_DIR=\"$(abs_srcdir)\" \
-I$(top_srcdir)/test \
-I$(top_srcdir)/googletest/include \
$(SQLITE_CFLAGS) \
$(RAPIDJSON_CFLAGS) \
$(VLCPP_CFLAGS) \
$(VLC_CFLAGS) \
$(libmedialibrary_la_CPPFLAGS) \
$(NULL)
samples_LDADD = \
libmedialibrary.la \
libgtest.la \
libgtestmain.la \
$(PTHREAD_LIBS) \
$(SQLITE_LIBS) \
$(NULL)
EXTRA_PROGRAMS = test_discoverer sqlite_load
test_discoverer_SOURCES = test/discoverer/main.cpp
test_discoverer_CXXFLAGS = $(MEDIALIB_CPPFLAGS)
test_discoverer_LDADD = libmedialibrary.la $(SQLITE_LIBS)
sqlite_load_SOURCES = test/sqlite_load/SqliteLoadTest.cpp
sqlite_load_CPPFLAGS = -I$(top_srcdir)/test
sqlite_load_CXXFLAGS = $(MEDIALIB_CPPFLAGS)
sqlite_load_LDADD = libmedialibrary.la $(SQLITE_LIBS)
endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = medialibrary.pc
EXTRA_DIST += medialibrary.pc \
src/database/migrations/migration3-5.sql \
src/database/migrations/migration7-8.sql
src/database/migrations/migration7-8.sql \
src/database/migrations/migration13-14.sql \
src/database/migrations/migration14-15.sql \
src/database/migrations/migration15-16.sql \
src/database/migrations/migration16-17.sql \
src/database/migrations/migration17-18.sql \
src/database/tables/File_v14.sql \
src/database/tables/File_triggers_v14.sql \
src/database/tables/Media_v14.sql \
src/database/tables/Media_v17.sql \
src/database/tables/Media_triggers_v14.sql \
src/database/tables/Folder_v14.sql \
src/database/tables/Folder_v15.sql \
src/database/tables/Folder_v16.sql \
src/database/tables/Folder_triggers_v14.sql \
src/database/tables/Folder_triggers_v15.sql \
src/database/tables/Playlist_v14.sql \
src/database/tables/Playlist_v16.sql \
src/database/tables/Playlist_triggers_v14.sql \
src/database/tables/Playlist_triggers_v16.sql \
src/database/tables/Metadata_v14.sql \
src/database/tables/Device_v14.sql \
src/database/tables/Task_v14.sql \
src/database/tables/Task_v18.sql \
src/database/tables/Task_triggers_v18.sql \
src/database/tables/Thumbnail_v17.sql \
src/database/tables/Thumbnail_triggers_v17.sql \
src/database/tables/Thumbnail_v18.sql \
src/database/tables/Thumbnail_triggers_v18.sql \
src/database/tables/Artist_v16.sql \
src/database/tables/Artist_v17.sql \
src/database/tables/Album_v16.sql \
src/database/tables/Album_v17.sql \
src/database/tables/Bookmark_v17.sql \
$(NULL)
m4_define([MEDIALIB_MAJOR], [0])
m4_define([MEDIALIB_MINOR], [2])
m4_define([MEDIALIB_MICRO], [0])
AC_COPYRIGHT([Copyright 2014-2019 Hugo Beauzée-Luyssen - VideoLabs - VideoLAN])
AC_COPYRIGHT([Copyright 2014-2017 Hugo Beauzée-Luyssen - VideoLabs - VideoLAN])
AC_INIT([medialibrary], [MEDIALIB_MAJOR.MEDIALIB_MINOR.MEDIALIB_MICRO])
AC_INIT([medialibrary], [0.6.0-dev])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign subdir-objects])
......@@ -13,19 +9,12 @@ m4_ifdef([AM_SILENT_RULES], [
])
AC_CANONICAL_HOST
MEDIALIBRARY_MAJOR=MEDIALIB_MAJOR
MEDIALIBRARY_MINOR=MEDIALIB_MINOR
MEDIALIBRARY_MICRO=MEDIALIB_MICRO
AC_SUBST(MEDIALIBRARY_MAJOR)
AC_SUBST(MEDIALIBRARY_MINOR)
AC_SUBST(MEDIALIBRARY_MICRO)
AC_USE_SYSTEM_EXTENSIONS
LT_INIT([win32-dll shared disable-static])
AC_PROG_CXX
AC_PROG_OBJCXX
AX_CXX_COMPILE_STDCXX_11([noext])
AX_CXX_COMPILE_STDCXX_14([noext])
AC_CONFIG_MACRO_DIR([m4])
......@@ -45,6 +34,9 @@ case "${host_os}" in
;;
linux*)
SYS=linux
CXXFLAGS="${CXXFLAGS} -pthread"
dnl Specify -lpthread as part of Libs.private, in case of a static build
THREAD_LIBS="-lpthread"
;;
bsdi*)
SYS=bsdi
......@@ -96,6 +88,7 @@ case "${host_os}" in
OBJCXX="${OBJCXX} -stdlib=libc++ -std=c++11"
OBJCXXFLAGS="${OBJCXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
ML_EXTRA_LIBS="-Wl,-framework,Foundation -lmedialibrary_macos"
AC_EGREP_CPP(yes,
[#import <TargetConditionals.h>
......@@ -156,7 +149,6 @@ case "${host_os}" in
;;
*mingw32* | *cygwin* | *wince* | *mingwce*)
CXXFLAGS="${CXXFLAGS} -static-libgcc -static-libstdc++"
AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
......@@ -173,28 +165,6 @@ case "${host_os}" in
if test "${SYS}" = "mingw32"; then
# DEP, ASLR, NO SEH
LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
ac_default_prefix="`pwd`/_win32"
DESTDIR="`pwd`/_win32/"
dnl
dnl NSIS/MSI Installer prefix and WIN64
dnl
case "${host}" in
amd64*|x86_64*)
HAVE_WIN64="1"
WINDOWS_ARCH="x64"
PROGRAMFILES="PROGRAMFILES64"
;;
*)
WINDOWS_ARCH="x86"
PROGRAMFILES="PROGRAMFILES"
;;
esac
AC_SUBST(WINDOWS_ARCH)
AC_SUBST(PROGRAMFILES)
fi
;;
*nto*)
......@@ -223,6 +193,9 @@ AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
AM_CONDITIONAL(HAVE_TVOS, test "${HAVE_TVOS}" = "1")
AC_LANG_PUSH([C++])
AC_CHECK_FUNCS([link])
AC_MSG_CHECKING([c++11 thread support])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include <thread>
int main() { std::thread t; }])], [
......@@ -277,37 +250,42 @@ AS_IF([test "${enable_debug}" = "no"],[
AC_DEFINE(NDEBUG)
])
PKG_CHECK_MODULES(SQLITE, sqlite3)
PKG_CHECK_MODULES(VLC, libvlc >= 3.0)
PKG_CHECK_MODULES(VLCPP, libvlcpp,
[AC_MSG_RESULT([Found libvlcpp.pc])],
[
# Checking for files doesn't work when cross compiling. Simply assume
# The file is there
AC_MSG_RESULT([Falling back to submodule])
AC_SUBST([VLCPP_CFLAGS],[-I${srcdir}/libvlcpp])
]
)
PKG_CHECK_MODULES(LIBJPEG, libjpeg, [
have_libjpeg="yes"
AC_DEFINE(HAVE_JPEG, 1, [Define to 1 if libjpeg is available])
])
AC_ARG_WITH(libvlc, [AC_HELP_STRING([--with-libvlc], [build with libvlc integration (default enabled)])],, [with_libvlc=yes])
AH_TEMPLATE(HAVE_LIBVLC, [Define to 1 if libvlc integration is enabled])
AS_IF([test "${with_libvlc}" != "no"], [
AC_DEFINE(HAVE_LIBVLC)
PKG_CHECK_MODULES(VLC, libvlc >= 4.0, [have_libvlc4="yes"], [
PKG_CHECK_MODULES(VLC, libvlc >= 3.0)
])
PKG_CHECK_MODULES(VLCPP, libvlcpp,
[AC_MSG_RESULT([Found libvlcpp.pc])],
[
# Checking for files doesn't work when cross compiling. Simply assume
# The file is there
AC_MSG_RESULT([Falling back to submodule])
AC_SUBST([VLCPP_CFLAGS],[-I${srcdir}/libvlcpp])
]
)
PKG_CHECK_MODULES(LIBJPEG, libjpeg, [
have_libjpeg="yes"
AC_DEFINE(HAVE_JPEG, 1, [Define to 1 if libjpeg is available])
], [
dnl Falling back to libjpeg.h based detection
AC_CHECK_HEADERS(jpeglib.h, [
have_libjpeg="yes"
AC_SUBST([LIBJPEG_LIBS], "-ljpeg")
])
])
])
AM_CONDITIONAL(HAVE_LIBVLC, [test "${with_libvlc}" != "no"])
AM_CONDITIONAL(HAVE_LIBVLC4, [test "${have_libvlc4}" = "yes" ])
AM_CONDITIONAL([HAVE_LIBJPEG], [test "${have_libjpeg}" = "yes"])
AC_ARG_ENABLE(evas, AC_HELP_STRING([--enable-evas], [Use evas to compress thumbnails]))
AS_IF([test "$enable_evas" = "yes"],
[PKG_CHECK_MODULES(EVAS, evas, [
have_evas="yes"
AC_DEFINE(HAVE_EVAS, 1, [Define to 1 if evas is available])
])])
AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
PKG_CHECK_MODULES(SQLITE, sqlite3)
AC_ARG_ENABLE(tests,AC_HELP_STRING([--disable-tests], [Disable build of automated tests suites]))
AM_CONDITIONAL([HAVE_TESTS], [test "${enable_tests}" = "yes"])
AS_IF([test "${enable_tests}" = "yes"], [
AX_PTHREAD([have_pthread=yes],[have_pthread=no])
PKG_CHECK_MODULES(RAPIDJSON, RapidJSON, [], [
# We need the .pc for cross compilation, but we don't consider it a failure
# when building natively, mostly because debian doesn't package the .pc
......@@ -318,7 +296,6 @@ AS_IF([test "${enable_tests}" = "yes"], [
fi
])
])
AM_CONDITIONAL([HAVE_PTHREAD], [test "${have_pthread}" = "yes"])
AH_BOTTOM([#include "Fixup.h"])
......@@ -329,4 +306,8 @@ Makefile
medialibrary.pc
])
AC_SUBST([THREAD_LIBS])
AC_SUBST([ML_EXTRA_LIBS])
AC_SUBST([ML_EXTRA_PRIVATE_LIBS])
AC_OUTPUT
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015 Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
......
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2016 Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2016-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
......
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015 Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
......@@ -25,9 +25,10 @@
#include <string>
#include "Types.h"
#include "filesystem/IDirectory.h"
#include "filesystem/IFile.h"
#include "medialibrary/filesystem/IDirectory.h"
#include "medialibrary/filesystem/IFile.h"
#include "medialibrary/IMediaLibrary.h"
#include "medialibrary/IInterruptProbe.h"
namespace medialibrary
{
......@@ -36,12 +37,11 @@ class IDiscoverer
{
public:
virtual ~IDiscoverer() = default;
// We assume the media library will always outlive the discoverers.
//FIXME: This is currently false since there is no way of interrupting
//a discoverer thread
virtual bool discover( const std::string& entryPoint ) = 0;
virtual bool reload() = 0;
virtual bool reload( const std::string& entryPoint ) = 0;
virtual bool discover( const std::string& entryPoint,
const IInterruptProbe& interruptProbe ) = 0;
virtual bool reload( const IInterruptProbe& interruptProbe ) = 0;
virtual bool reload( const std::string& entryPoint,
const IInterruptProbe& interruptProbe ) = 0;
};
}
......
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015 Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
......@@ -22,7 +22,6 @@
#pragma once
#include <vector>
#include <string>
#include "IMediaLibrary.h"
......@@ -41,33 +40,58 @@ public:
*/
virtual unsigned int releaseYear() const = 0;
virtual const std::string& shortSummary() const = 0;
virtual const std::string& artworkMrl() const = 0;
/**
* @brief isThumbnailGenerated Returns true is a thumbnail generation was attempted.
*
* If the thumbnail generation failed, this will still return true, and the
* associated thumbnail mrl will be empty.
*/
virtual bool isThumbnailGenerated( ThumbnailSizeType sizeType ) const = 0;
virtual const std::string& thumbnailMrl( ThumbnailSizeType sizeType ) const = 0;
/**
* @brief tracks fetches album tracks from the database
*/
virtual std::vector<MediaPtr> tracks( SortingCriteria sort = SortingCriteria::Default, bool desc = false ) const = 0;
virtual Query<IMedia> tracks( const QueryParameters* params = nullptr ) const = 0;
/**
* @brief tracks fetches album tracks, filtered by genre
* @param genre A musical genre. Only tracks of this genre will be returned
* @return
*/
virtual std::vector<MediaPtr> tracks( GenrePtr genre, SortingCriteria sort = SortingCriteria::Default, bool desc = false ) const = 0;
virtual Query<IMedia> tracks( GenrePtr genre, const QueryParameters* params = nullptr ) const = 0;
/**
* @brief albumArtist Returns the album main artist (generally tagged as album-artist)
* This can be an artist that doesn't appear on the album, and is solely dependent
* on the most present AlbumArtist tag for all of this album's tracks
*/
virtual ArtistPtr albumArtist() const = 0;
/**
* @brief artists Returns a vector of all additional artists appearing on the album.
* @brief artists Returns a Query object representing all artists appearing
* on at least one track for this album.
* Artists are sorted by name.
* @param desc
*/
virtual std::vector<ArtistPtr> artists( bool desc ) const = 0;
virtual Query<IArtist> artists( const QueryParameters* params = nullptr ) const = 0;
/**
* @brief nbTracks Returns the amount of track in this album.
* The value is cached, and doesn't require fetching anything.
*/
virtual uint32_t nbTracks() const = 0;
virtual unsigned int duration() const = 0;
/**
* @brief nbDiscs Returns the total number of discs for this album.
* Defaults to 1
*/
virtual uint32_t nbDiscs() const = 0;
/**
* @brief duration Returns the total album duration in milliseconds
*/
virtual int64_t duration() const = 0;
/**
* @brief isUnknownAlbum returns true is this is an unknown album
*/
virtual bool isUnknownAlbum() const = 0;
virtual Query<IMedia> searchTracks( const std::string& pattern,
const QueryParameters* params = nullptr ) const = 0;
};
}
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015 Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
......@@ -43,10 +43,12 @@ class IAlbumTrack
* @return
*/
virtual ArtistPtr artist() const = 0;
virtual int64_t artistId() const = 0;
virtual GenrePtr genre() = 0;
virtual unsigned int trackNumber() = 0;
virtual int64_t genreId() const = 0;
virtual unsigned int trackNumber() const = 0;
virtual AlbumPtr album() = 0;
virtual MediaPtr media() = 0;
virtual int64_t albumId() const = 0;
/**
* @return Which disc this tracks appears on (or 0 if unspecified)
*/
......
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015 Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
......@@ -23,7 +23,6 @@
#pragma once
#include <string>
#include <vector>
#include "IMediaLibrary.h"
......@@ -43,9 +42,33 @@ public:
* This will return all albums by this artist, and all album the artist
* appeared on, even if they are not the main artist (or AlbumArtist)
*/
virtual std::vector<AlbumPtr> albums( SortingCriteria sort = SortingCriteria::Default, bool desc = false ) const = 0;
virtual std::vector<MediaPtr> media( SortingCriteria sort = SortingCriteria::Default, bool desc = false ) const = 0;
virtual const std::string& artworkMrl() const = 0;
virtual Query<IAlbum> albums( const QueryParameters* params = nullptr ) const = 0;
virtual Query<IAlbum> searchAlbums( const std::string& pattern,
const QueryParameters* params = nullptr ) const = 0;
virtual Query<IMedia> tracks( const QueryParameters* params = nullptr ) const = 0;
virtual Query<IMedia> searchTracks( const std::string& pattern,
const QueryParameters* params = nullptr ) const = 0;
/**
* @brief isThumbnailGenerated Returns true is a thumbnail generation was
* attempted for the provided size.
*
* @param sizeType The targeted thumbnail size
*
* If the thumbnail generation failed, this will still return true, and the
* associated thumbnail mrl will be empty.
*/
virtual bool isThumbnailGenerated( ThumbnailSizeType sizeType ) const = 0;
virtual const std::string& thumbnailMrl( ThumbnailSizeType sizeType ) const = 0;
/**
* @brief setThumbnail Assign a thumbnail to the artist
* @param thumbnailMrl An mrl pointing to the thumbnail
* @return true in case of success, false otherwise
*
* @note The medialibrary does not take ownership of the thumbnail. It is
* application responsibility to ensure that it will always be available
* or that a later call will invalidate the thumbnail if it gets (re)moved
*/
virtual bool setThumbnail( const std::string& thumbnailMrl, ThumbnailSizeType sizeType ) = 0;
virtual const std::string& musicBrainzId() const = 0;
/**
* @brief nbAlbums
......
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015 Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
......@@ -20,8 +20,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef IAUDIOTRACK_H
#define IAUDIOTRACK_H
#pragma once
#include "IMediaLibrary.h"
......@@ -30,20 +29,18 @@ namespace medialibrary
class IAudioTrack
{
public:
virtual ~IAudioTrack() {}
virtual int64_t id() const = 0;
virtual const std::string& codec() const = 0;
/**
* @return The bitrate in bits per second
*/
virtual unsigned int bitrate() const = 0;
virtual unsigned int sampleRate() const = 0;
virtual unsigned int nbChannels() const = 0;
virtual const std::string& language() const = 0;
virtual const std::string& description() const = 0;
public:
virtual ~IAudioTrack() = default;
virtual int64_t id() const = 0;
virtual const std::string& codec() const = 0;
/**
* @return The bitrate in bits per second
*/
virtual unsigned int bitrate() const = 0;
virtual unsigned int sampleRate() const = 0;
virtual unsigned int nbChannels() const = 0;
virtual const std::string& language() const = 0;
virtual const std::string& description() const = 0;
};
}
#endif // IAUDIOTRACK_H
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#pragma once
#include <cstdint>
#include <string>
namespace medialibrary
{
class IBookmark
{
public:
virtual ~IBookmark() = default;
/**
* @brief time Returns the time of this bookmark, as it was
* provided to \ref{IMedia::addBookmark}
*/
virtual int64_t time() const = 0;
/**
* @brief name Returns the bookmark name
*/
virtual const std::string& name() const = 0;
/**
* @brief setName Updates the bookmark name
*/
virtual bool setName( std::string name ) = 0;
/**
* @brief name Returns the bookmark description
*/
virtual const std::string& description() const = 0;
/**
* @brief setDescription Updates the bookmark description
*/
virtual bool setDescription( std::string description ) = 0;
/**
* @brief setNameAndDescription Convenience helper to update the name and
* description in a single operation
*/
virtual bool setNameAndDescription( std::string name, std::string desc ) = 0;
/**
* @brief move Move a bookmark to a new time in the media
* @param newTime The new time for this bookmark
* @return true if successful, false otherwise.
*
* @note If a bookmark is already present at the given time, the move will fail
*/
virtual bool move( int64_t newTime ) = 0;
};
}
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2018-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#pragma once
#include <string>
namespace medialibrary
{
class IChapter
{
public:
virtual ~IChapter() = default;
/**
* @brief name Returns the chapter name
*/
virtual const std::string& name() const = 0;
/**
* @brief offset Returns the offset from the start of the media in seconds
*/
virtual int64_t offset() const = 0;
/**
* @brief duration Returns the duration of this chapter in seconds
*/
virtual int64_t duration() const = 0;
};
}
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015 Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
......@@ -28,22 +28,30 @@
namespace medialibrary
{
/**
* @brief IDeviceListerCb is intended for external device listers to signal device modifications
*
* An external device lister shall only be used when the medialibrary can't list
* the devices itself.
* The device/folder/file management will still be the medialibrary's responsability
*/
class IDeviceListerCb
{
public:
virtual ~IDeviceListerCb() = default;
/**
* @brief onDevicePlugged Shall be invoked when a known device gets plugged
* @brief onDeviceMounted Shall be invoked when a known device gets mounted
* @param uuid The device UUID
* @param mountpoint The device new mountpoint
* @returns true is the device was unknown. false otherwise
*/
virtual bool onDevicePlugged( const std::string& uuid, const std::string& mountpoint ) = 0;
virtual bool onDeviceMounted( const std::string& uuid, const std::string& mountpoint ) = 0;
/**
* @brief onDeviceUnplugged Shall be invoked when a known device gets unplugged
* @brief onDeviceUnmounted Shall be invoked when a known device gets unmounted
* @param uuid The device UUID
* @param mountpoint The mountpoint the device was mounted on
*/
virtual void onDeviceUnplugged( const std::string& uuid ) = 0;
virtual void onDeviceUnmounted( const std::string& uuid, const std::string& mountpoint ) = 0;
/**
* @brief isDeviceKnown Returns true is the provided device is already known to the media library
*
......
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015 Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
......@@ -30,6 +30,12 @@ namespace medialibrary
class IFile
{
public:
/**
* @brief Describes the type of a file
* @warning These values are stored in DB. As such, any new value must be
* appended, as modifying the existing values would invalidate any
* existing db record.
*/
enum class Type
{
/// Unknown type, so far
......@@ -44,18 +50,43 @@ public:
Subtitles,
/// A playlist File
Playlist,
/// A disc file. Also considered to be a "main" file
Disc,
};
virtual ~IFile() = default;
virtual int64_t id() const = 0;
/**
* @brief mrl Returns the full mrl for this file.
* Since we can't compute an mrl for a file or folder that is/was present on
* a removable storage or network share that is not mounted, a
* fs::DeviceRemovedException will be thrown when trying to get the mrl of
* a non present file.
* You should always account for this exception is isRemovable returns true.
* If for some reasons we can't compute the MRL, an empty string will be returned
* @return The folder's mrl
*/
virtual const std::string& mrl() const = 0;
virtual Type type() const = 0;
virtual unsigned int lastModificationDate() const = 0;
virtual unsigned int size() const = 0;
virtual bool isRemovable() const = 0;
///
/// \brief isExternal returns true if this stream isn't managed by the medialibrary
///
virtual bool isExternal() const = 0;
/**
* @brief isNetwork returns true if this file is on a network location
*
* If the file is external, this is a best guess effort.
*/
virtual bool isNetwork() const = 0;
/**
* @brief isMain Returns true if this file is the main file of a media
*
* This can be used to have a Disc file considered as the main file
*/
virtual bool isMain() const = 0;
};
}
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015 Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
......@@ -23,6 +23,9 @@
#pragma once
#include <string>
#include "IQuery.h"
#include "IMedia.h"
#include "IMediaLibrary.h"
namespace medialibrary
{
......@@ -34,19 +37,84 @@ public:
virtual int64_t id() const = 0;
/**
* @brief mrl Returns the full mrl for this folder.
* Caller is responsible for checking isPresent() beforehand, as we
* can't compute an for a folder that is/was present on a removable storage
* or network share that has been unplugged
* If for some reasons we can't compute the MRL, an empty string wil
* Since we can't compute an mrl for a folder that is/was present on a
* removable storage or network share that is not mounted, a
* fs::DeviceRemovedException will be thrown when trying to get the mrl of
* a non present folder.
* Calling isPresent can prevent this to be called with a known missing
* device, but there is always a window between a call to isPresent and mrl()
* in which the device could be removed.
* When calling this function on a removable device, you should check
* for fs::DeviceRemovedException in any case.
* If for some reasons we can't compute the MRL, an empty string will be returned
* @return The folder's mrl
*/
virtual const std::string& mrl() const = 0;
virtual const std::string& name() const = 0;
virtual bool isPresent() const = 0;
virtual bool isRemovable() const = 0;
/**
* @brief isBanned Will return true if the folder was explicitely banned
* from being discovered.
*/
virtual bool isBanned() const = 0;
/**
* @brief media Returns the media contained by this folder.
* @param type The media type, or IMedia::Type::Unknown for all types
* @param params A query parameter instance, or nullptr for the default
* @return A Query object to be used to fetch the results
*
* This function will only return the media contained in the folder, not
* the media contained in subfolders.
* A media is considered to be in a directory when the main file representing
* it is part of the directory.
* For instance, in this file hierarchy:
* .
* ├── a
* │ ├── c
* │ │ └── NakedMoleRat.asf
* │ └── seaotter_themovie.srt
* └── b
* └── seaotter_themovie.mkv
* Media of 'a' would be empty (since the only file is a subtitle file and
* not the actual media, and NakedMoleRat.asf
* is in a subfolder)
* Media of 'c' would contain NakedMoleRat.asf
* Media of 'b' would contain seaotter_themovie.mkv
*/
virtual Query<IMedia> media( IMedia::Type type,
const QueryParameters* params ) const = 0;
/**
* @brief searchMedia Search the media of a given folder
* @param pattern The pattern to search for
* @param type The media type, or IMedia::Type::Unknown for all types
* @param params A query parameter instance, or nullptr for the default
* @return A Query object to be used to fetch the results
*
* This only search for the folder in a specific folder, not including the
* media in its subfolders.
*/
virtual Query<IMedia> searchMedia( const std::string& pattern,
IMedia::Type type,
const QueryParameters* params = nullptr ) const = 0;
/**
* @brief subfolders Returns the subfolders contained folder
* @return A query object to be used to fetch the results