Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
e1085680
Commit
e1085680
authored
May 19, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/proxy: require libmpdclient 2.11 or later
Remove lots of #ifdefs.
parent
360381e6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
28 deletions
+2
-28
NEWS
NEWS
+1
-0
ProxyDatabasePlugin.cxx
src/db/plugins/ProxyDatabasePlugin.cxx
+0
-27
meson.build
src/db/plugins/meson.build
+1
-1
No files found.
NEWS
View file @
e1085680
...
...
@@ -4,6 +4,7 @@ ver 0.23 (not yet released)
- show the audio format in "playlistinfo"
* database
- proxy: require MPD 0.20 or later
- proxy: require libmpdclient 2.11 or later
* output
- pipewire: new plugin
- snapcast: new plugin
...
...
src/db/plugins/ProxyDatabasePlugin.cxx
View file @
e1085680
...
...
@@ -178,14 +178,10 @@ static constexpr struct {
{
TAG_MUSICBRAINZ_ALBUMARTISTID
,
MPD_TAG_MUSICBRAINZ_ALBUMARTISTID
},
{
TAG_MUSICBRAINZ_TRACKID
,
MPD_TAG_MUSICBRAINZ_TRACKID
},
#if LIBMPDCLIENT_CHECK_VERSION(2,10,0)
{
TAG_MUSICBRAINZ_RELEASETRACKID
,
MPD_TAG_MUSICBRAINZ_RELEASETRACKID
},
#endif
#if LIBMPDCLIENT_CHECK_VERSION(2,11,0)
{
TAG_ARTIST_SORT
,
MPD_TAG_ARTIST_SORT
},
{
TAG_ALBUM_ARTIST_SORT
,
MPD_TAG_ALBUM_ARTIST_SORT
},
#endif
#if LIBMPDCLIENT_CHECK_VERSION(2,12,0)
{
TAG_ALBUM_SORT
,
MPD_TAG_ALBUM_SORT
},
#endif
...
...
@@ -388,7 +384,6 @@ SendConstraints(mpd_connection *connection, const DatabaseSelection &selection)
!
SendConstraints
(
connection
,
*
selection
.
filter
))
return
false
;
#if LIBMPDCLIENT_CHECK_VERSION(2, 11, 0)
if
(
selection
.
sort
!=
TAG_NUM_OF_ITEM_TYPES
&&
mpd_connection_cmp_server_version
(
connection
,
0
,
21
,
0
)
>=
0
)
{
#if LIBMPDCLIENT_CHECK_VERSION(2, 15, 0)
...
...
@@ -410,14 +405,11 @@ SendConstraints(mpd_connection *connection, const DatabaseSelection &selection)
}
#endif
}
#endif
#if LIBMPDCLIENT_CHECK_VERSION(2, 10, 0)
if
(
selection
.
window
!=
RangeArg
::
All
()
&&
!
mpd_search_add_window
(
connection
,
selection
.
window
.
start
,
selection
.
window
.
end
))
return
false
;
#endif
return
true
;
}
...
...
@@ -527,12 +519,7 @@ ProxyDatabase::Connect()
host
.
c_str
()));
}
#if LIBMPDCLIENT_CHECK_VERSION(2, 10, 0)
mpd_connection_set_keepalive
(
connection
,
keepalive
);
#else
// suppress -Wunused-private-field
(
void
)
keepalive
;
#endif
idle_received
=
~
0U
;
is_idle
=
false
;
...
...
@@ -865,8 +852,6 @@ try {
throw
;
}
#if LIBMPDCLIENT_CHECK_VERSION(2, 10, 0)
gcc_pure
static
bool
IsFilterSupported
(
const
ISongFilter
&
f
)
noexcept
...
...
@@ -920,10 +905,6 @@ IsFilterFullySupported(const SongFilter *filter,
IsFilterFullySupported
(
*
filter
,
connection
);
}
#endif
#if LIBMPDCLIENT_CHECK_VERSION(2, 11, 0)
gcc_pure
static
bool
IsSortSupported
(
TagType
tag_type
,
...
...
@@ -946,8 +927,6 @@ IsSortSupported(TagType tag_type,
return
Convert
(
tag_type
)
!=
MPD_TAG_COUNT
;
}
#endif
gcc_pure
static
DatabaseSelection
CheckSelection
(
DatabaseSelection
selection
,
...
...
@@ -956,23 +935,17 @@ CheckSelection(DatabaseSelection selection,
selection
.
uri
.
clear
();
selection
.
filter
=
nullptr
;
#if LIBMPDCLIENT_CHECK_VERSION(2, 11, 0)
if
(
selection
.
sort
!=
TAG_NUM_OF_ITEM_TYPES
&&
IsSortSupported
(
selection
.
sort
,
connection
))
/* we can forward the "sort" parameter to the other
MPD */
selection
.
sort
=
TAG_NUM_OF_ITEM_TYPES
;
#endif
#if LIBMPDCLIENT_CHECK_VERSION(2, 10, 0)
if
(
selection
.
window
!=
RangeArg
::
All
()
&&
IsFilterFullySupported
(
selection
.
filter
,
connection
))
/* we can forward the "window" parameter to the other
MPD */
selection
.
window
=
RangeArg
::
All
();
#else
(
void
)
connection
;
#endif
return
selection
;
}
...
...
src/db/plugins/meson.build
View file @
e1085680
...
...
@@ -23,7 +23,7 @@ if upnp_dep.found()
]
endif
libmpdclient_dep = dependency('libmpdclient', version: '>= 2.
9
', required: get_option('libmpdclient'))
libmpdclient_dep = dependency('libmpdclient', version: '>= 2.
11
', required: get_option('libmpdclient'))
conf.set('ENABLE_LIBMPDCLIENT', libmpdclient_dep.found())
if libmpdclient_dep.found()
db_plugins_sources += 'ProxyDatabasePlugin.cxx'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment