Merge branch 'v0.22.x'
This commit is contained in:
commit
4ee0a06e18
4
NEWS
4
NEWS
|
@ -15,6 +15,10 @@ ver 0.23 (not yet released)
|
||||||
* new build-time dependency: libfmt
|
* new build-time dependency: libfmt
|
||||||
|
|
||||||
ver 0.22.9 (not yet released)
|
ver 0.22.9 (not yet released)
|
||||||
|
* database
|
||||||
|
- simple: load all .mpdignore files of all parent directories
|
||||||
|
* decoder
|
||||||
|
- ffmpeg: support the tags "sort_album", "album-sort", "artist-sort"
|
||||||
* Windows
|
* Windows
|
||||||
- fix build failure with SQLite
|
- fix build failure with SQLite
|
||||||
|
|
||||||
|
|
|
@ -312,6 +312,29 @@ UpdateWalk::SkipSymlink(const Directory *directory,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
LoadExcludeListOrThrow(const Storage &storage, const Directory &directory,
|
||||||
|
ExcludeList &exclude_list)
|
||||||
|
{
|
||||||
|
Mutex mutex;
|
||||||
|
auto is = InputStream::OpenReady(storage.MapUTF8(PathTraitsUTF8::Build(directory.GetPath(),
|
||||||
|
".mpdignore")).c_str(),
|
||||||
|
mutex);
|
||||||
|
exclude_list.Load(std::move(is));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
LoadExcludeListOrLog(const Storage &storage, const Directory &directory,
|
||||||
|
ExcludeList &exclude_list) noexcept
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
LoadExcludeListOrThrow(storage, directory, exclude_list);
|
||||||
|
} catch (...) {
|
||||||
|
if (!IsFileNotFound(std::current_exception()))
|
||||||
|
LogError(std::current_exception());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
UpdateWalk::UpdateDirectory(Directory &directory,
|
UpdateWalk::UpdateDirectory(Directory &directory,
|
||||||
const ExcludeList &exclude_list,
|
const ExcludeList &exclude_list,
|
||||||
|
@ -331,17 +354,7 @@ UpdateWalk::UpdateDirectory(Directory &directory,
|
||||||
}
|
}
|
||||||
|
|
||||||
ExcludeList child_exclude_list(exclude_list);
|
ExcludeList child_exclude_list(exclude_list);
|
||||||
|
LoadExcludeListOrLog(storage, directory, child_exclude_list);
|
||||||
try {
|
|
||||||
Mutex mutex;
|
|
||||||
auto is = InputStream::OpenReady(storage.MapUTF8(PathTraitsUTF8::Build(directory.GetPath(),
|
|
||||||
".mpdignore")).c_str(),
|
|
||||||
mutex);
|
|
||||||
child_exclude_list.Load(std::move(is));
|
|
||||||
} catch (...) {
|
|
||||||
if (!IsFileNotFound(std::current_exception()))
|
|
||||||
LogError(std::current_exception());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!child_exclude_list.IsEmpty())
|
if (!child_exclude_list.IsEmpty())
|
||||||
RemoveExcludedFromDirectory(directory, child_exclude_list);
|
RemoveExcludedFromDirectory(directory, child_exclude_list);
|
||||||
|
@ -445,6 +458,28 @@ UpdateWalk::DirectoryMakeUriParentChecked(Directory &root,
|
||||||
return directory;
|
return directory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
LoadExcludeLists(std::forward_list<ExcludeList> &lists,
|
||||||
|
const Storage &storage, const Directory &directory) noexcept
|
||||||
|
{
|
||||||
|
assert(!lists.empty());
|
||||||
|
|
||||||
|
if (!directory.IsRoot())
|
||||||
|
LoadExcludeLists(lists, storage, *directory.parent);
|
||||||
|
|
||||||
|
lists.emplace_front();
|
||||||
|
LoadExcludeListOrLog(storage, directory, lists.front());
|
||||||
|
}
|
||||||
|
|
||||||
|
static auto
|
||||||
|
LoadExcludeLists(const Storage &storage, const Directory &directory) noexcept
|
||||||
|
{
|
||||||
|
std::forward_list<ExcludeList> lists;
|
||||||
|
lists.emplace_front();
|
||||||
|
LoadExcludeLists(lists, storage, directory);
|
||||||
|
return lists;
|
||||||
|
}
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
UpdateWalk::UpdateUri(Directory &root, const char *uri) noexcept
|
UpdateWalk::UpdateUri(Directory &root, const char *uri) noexcept
|
||||||
try {
|
try {
|
||||||
|
@ -465,9 +500,8 @@ try {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExcludeList exclude_list;
|
const auto exclude_lists = LoadExcludeLists(storage, *parent);
|
||||||
|
UpdateDirectoryChild(*parent, exclude_lists.front(), name, info);
|
||||||
UpdateDirectoryChild(*parent, exclude_list, name, info);
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
LogError(std::current_exception());
|
LogError(std::current_exception());
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,11 +30,22 @@ extern "C" {
|
||||||
#include <libavutil/dict.h>
|
#include <libavutil/dict.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FFmpeg specific tag name mappings, as supported by
|
||||||
|
* libavformat/id3v2.c, libavformat/mov.c and others.
|
||||||
|
*/
|
||||||
static constexpr struct tag_table ffmpeg_tags[] = {
|
static constexpr struct tag_table ffmpeg_tags[] = {
|
||||||
{ "year", TAG_DATE },
|
/* from libavformat/id3v2.c, libavformat/mov.c */
|
||||||
{ "author-sort", TAG_ARTIST_SORT },
|
|
||||||
{ "album_artist", TAG_ALBUM_ARTIST },
|
{ "album_artist", TAG_ALBUM_ARTIST },
|
||||||
{ "album_artist-sort", TAG_ALBUM_ARTIST_SORT },
|
|
||||||
|
/* from libavformat/id3v2.c */
|
||||||
|
{ "album-sort", TAG_ALBUM_SORT },
|
||||||
|
{ "artist-sort", TAG_ARTIST_SORT },
|
||||||
|
|
||||||
|
/* from libavformat/mov.c */
|
||||||
|
{ "sort_album_artist", TAG_ALBUM_ARTIST_SORT },
|
||||||
|
{ "sort_album", TAG_ALBUM_SORT },
|
||||||
|
{ "sort_artist", TAG_ARTIST_SORT },
|
||||||
|
|
||||||
/* sentinel */
|
/* sentinel */
|
||||||
{ nullptr, TAG_NUM_OF_ITEM_TYPES }
|
{ nullptr, TAG_NUM_OF_ITEM_TYPES }
|
||||||
|
|
Loading…
Reference in New Issue