db/proxy: require libmpdclient 2.9
This commit is contained in:
parent
60620d9af5
commit
2d0b429b6a
1
NEWS
1
NEWS
|
@ -11,6 +11,7 @@ ver 0.21 (not yet released)
|
||||||
- new filter syntax for "find"/"search" etc. with negation
|
- new filter syntax for "find"/"search" etc. with negation
|
||||||
* database
|
* database
|
||||||
- simple: scan audio formats
|
- simple: scan audio formats
|
||||||
|
- proxy: require libmpdclient 2.9
|
||||||
* player
|
* player
|
||||||
- "one-shot" single mode
|
- "one-shot" single mode
|
||||||
* input
|
* input
|
||||||
|
|
|
@ -561,7 +561,7 @@ dnl ---------------------------------------------------------------------------
|
||||||
|
|
||||||
dnl -------------------------------- libmpdclient --------------------------------
|
dnl -------------------------------- libmpdclient --------------------------------
|
||||||
MPD_ENABLE_AUTO_PKG_DEPENDS(libmpdclient, LIBMPDCLIENT,
|
MPD_ENABLE_AUTO_PKG_DEPENDS(libmpdclient, LIBMPDCLIENT,
|
||||||
[libmpdclient >= 2.2],
|
[libmpdclient >= 2.9],
|
||||||
[MPD client library], [libmpdclient not found], [],
|
[MPD client library], [libmpdclient not found], [],
|
||||||
[enable_database], [Database support is disabled])
|
[enable_database], [Database support is disabled])
|
||||||
|
|
||||||
|
|
|
@ -212,10 +212,8 @@ ProxySong::ProxySong(const mpd_song *song)
|
||||||
if (_mtime > 0)
|
if (_mtime > 0)
|
||||||
mtime = std::chrono::system_clock::from_time_t(_mtime);
|
mtime = std::chrono::system_clock::from_time_t(_mtime);
|
||||||
|
|
||||||
#if LIBMPDCLIENT_CHECK_VERSION(2,3,0)
|
|
||||||
start_time = SongTime::FromS(mpd_song_get_start(song));
|
start_time = SongTime::FromS(mpd_song_get_start(song));
|
||||||
end_time = SongTime::FromS(mpd_song_get_end(song));
|
end_time = SongTime::FromS(mpd_song_get_end(song));
|
||||||
#endif
|
|
||||||
|
|
||||||
TagBuilder tag_builder;
|
TagBuilder tag_builder;
|
||||||
|
|
||||||
|
@ -299,7 +297,6 @@ SendConstraints(mpd_connection *connection, const ISongFilter &f)
|
||||||
return mpd_search_add_uri_constraint(connection,
|
return mpd_search_add_uri_constraint(connection,
|
||||||
MPD_OPERATOR_DEFAULT,
|
MPD_OPERATOR_DEFAULT,
|
||||||
u->GetValue().c_str());
|
u->GetValue().c_str());
|
||||||
#if LIBMPDCLIENT_CHECK_VERSION(2,9,0)
|
|
||||||
} else if (auto b = dynamic_cast<const BaseSongFilter *>(&f)) {
|
} else if (auto b = dynamic_cast<const BaseSongFilter *>(&f)) {
|
||||||
if (mpd_connection_cmp_server_version(connection, 0, 18, 0) < 0)
|
if (mpd_connection_cmp_server_version(connection, 0, 18, 0) < 0)
|
||||||
/* requires MPD 0.18 */
|
/* requires MPD 0.18 */
|
||||||
|
@ -308,7 +305,6 @@ SendConstraints(mpd_connection *connection, const ISongFilter &f)
|
||||||
return mpd_search_add_base_constraint(connection,
|
return mpd_search_add_base_constraint(connection,
|
||||||
MPD_OPERATOR_DEFAULT,
|
MPD_OPERATOR_DEFAULT,
|
||||||
b->GetValue());
|
b->GetValue());
|
||||||
#endif
|
|
||||||
} else
|
} else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -326,7 +322,6 @@ SendConstraints(mpd_connection *connection, const SongFilter &filter)
|
||||||
static bool
|
static bool
|
||||||
SendConstraints(mpd_connection *connection, const DatabaseSelection &selection)
|
SendConstraints(mpd_connection *connection, const DatabaseSelection &selection)
|
||||||
{
|
{
|
||||||
#if LIBMPDCLIENT_CHECK_VERSION(2,9,0)
|
|
||||||
if (!selection.uri.empty() &&
|
if (!selection.uri.empty() &&
|
||||||
mpd_connection_cmp_server_version(connection, 0, 18, 0) >= 0) {
|
mpd_connection_cmp_server_version(connection, 0, 18, 0) >= 0) {
|
||||||
/* requires MPD 0.18 */
|
/* requires MPD 0.18 */
|
||||||
|
@ -335,7 +330,6 @@ SendConstraints(mpd_connection *connection, const DatabaseSelection &selection)
|
||||||
selection.uri.c_str()))
|
selection.uri.c_str()))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (selection.filter != nullptr &&
|
if (selection.filter != nullptr &&
|
||||||
!SendConstraints(connection, *selection.filter))
|
!SendConstraints(connection, *selection.filter))
|
||||||
|
@ -615,11 +609,9 @@ Visit(struct mpd_connection *connection,
|
||||||
|
|
||||||
std::chrono::system_clock::time_point mtime =
|
std::chrono::system_clock::time_point mtime =
|
||||||
std::chrono::system_clock::time_point::min();
|
std::chrono::system_clock::time_point::min();
|
||||||
#if LIBMPDCLIENT_CHECK_VERSION(2,9,0)
|
|
||||||
time_t _mtime = mpd_directory_get_last_modified(directory);
|
time_t _mtime = mpd_directory_get_last_modified(directory);
|
||||||
if (_mtime > 0)
|
if (_mtime > 0)
|
||||||
mtime = std::chrono::system_clock::from_time_t(_mtime);
|
mtime = std::chrono::system_clock::from_time_t(_mtime);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (visit_directory)
|
if (visit_directory)
|
||||||
visit_directory(LightDirectory(path, mtime));
|
visit_directory(LightDirectory(path, mtime));
|
||||||
|
@ -785,13 +777,7 @@ gcc_pure
|
||||||
static bool
|
static bool
|
||||||
ServerSupportsSearchBase(const struct mpd_connection *connection) noexcept
|
ServerSupportsSearchBase(const struct mpd_connection *connection) noexcept
|
||||||
{
|
{
|
||||||
#if LIBMPDCLIENT_CHECK_VERSION(2,9,0)
|
|
||||||
return mpd_connection_cmp_server_version(connection, 0, 18, 0) >= 0;
|
return mpd_connection_cmp_server_version(connection, 0, 18, 0) >= 0;
|
||||||
#else
|
|
||||||
(void)connection;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue