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
5ece9685
Commit
5ece9685
authored
Jul 06, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PluginUnavailable: backport class PluginUnconfigured from master
Stop bothering people about the Tidal/Qobuz plugins.
parent
e7c5a428
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
8 deletions
+24
-8
PluginUnavailable.hxx
src/PluginUnavailable.hxx
+12
-1
Init.cxx
src/input/Init.cxx
+5
-0
QobuzInputPlugin.cxx
src/input/plugins/QobuzInputPlugin.cxx
+4
-4
TidalInputPlugin.cxx
src/input/plugins/TidalInputPlugin.cxx
+3
-3
No files found.
src/PluginUnavailable.hxx
View file @
5ece9685
...
@@ -27,9 +27,20 @@
...
@@ -27,9 +27,20 @@
* that this plugin is unavailable. It will be disabled, and MPD can
* that this plugin is unavailable. It will be disabled, and MPD can
* continue initialization.
* continue initialization.
*/
*/
class
PluginUnavailable
final
:
public
std
::
runtime_error
{
class
PluginUnavailable
:
public
std
::
runtime_error
{
public
:
public
:
using
std
::
runtime_error
::
runtime_error
;
using
std
::
runtime_error
::
runtime_error
;
};
};
/**
* Like #PluginUnavailable, but denotes that the plugin is not
* available because it was not explicitly enabled in the
* configuration. The message may describe the necessary steps to
* enable it.
*/
class
PluginUnconfigured
:
public
PluginUnavailable
{
public
:
using
PluginUnavailable
::
PluginUnavailable
;
};
#endif
#endif
src/input/Init.cxx
View file @
5ece9685
...
@@ -58,6 +58,11 @@ input_stream_global_init(const ConfigData &config, EventLoop &event_loop)
...
@@ -58,6 +58,11 @@ input_stream_global_init(const ConfigData &config, EventLoop &event_loop)
if
(
plugin
->
init
!=
nullptr
)
if
(
plugin
->
init
!=
nullptr
)
plugin
->
init
(
event_loop
,
*
block
);
plugin
->
init
(
event_loop
,
*
block
);
input_plugins_enabled
[
i
]
=
true
;
input_plugins_enabled
[
i
]
=
true
;
}
catch
(
const
PluginUnconfigured
&
e
)
{
LogFormat
(
LogLevel
::
INFO
,
e
,
"Input plugin '%s' is not configured"
,
plugin
->
name
);
continue
;
}
catch
(
const
PluginUnavailable
&
e
)
{
}
catch
(
const
PluginUnavailable
&
e
)
{
FormatError
(
e
,
FormatError
(
e
,
"Input plugin '%s' is unavailable"
,
"Input plugin '%s' is unavailable"
,
...
...
src/input/plugins/QobuzInputPlugin.cxx
View file @
5ece9685
...
@@ -133,11 +133,11 @@ InitQobuzInput(EventLoop &event_loop, const ConfigBlock &block)
...
@@ -133,11 +133,11 @@ InitQobuzInput(EventLoop &event_loop, const ConfigBlock &block)
const
char
*
app_id
=
block
.
GetBlockValue
(
"app_id"
);
const
char
*
app_id
=
block
.
GetBlockValue
(
"app_id"
);
if
(
app_id
==
nullptr
)
if
(
app_id
==
nullptr
)
throw
PluginUn
available
(
"No Qobuz app_id configured"
);
throw
PluginUn
configured
(
"No Qobuz app_id configured"
);
const
char
*
app_secret
=
block
.
GetBlockValue
(
"app_secret"
);
const
char
*
app_secret
=
block
.
GetBlockValue
(
"app_secret"
);
if
(
app_secret
==
nullptr
)
if
(
app_secret
==
nullptr
)
throw
PluginUn
available
(
"No Qobuz app_secret configured"
);
throw
PluginUn
configured
(
"No Qobuz app_secret configured"
);
const
char
*
device_manufacturer_id
=
block
.
GetBlockValue
(
"device_manufacturer_id"
,
const
char
*
device_manufacturer_id
=
block
.
GetBlockValue
(
"device_manufacturer_id"
,
"df691fdc-fa36-11e7-9718-635337d7df8f"
);
"df691fdc-fa36-11e7-9718-635337d7df8f"
);
...
@@ -145,11 +145,11 @@ InitQobuzInput(EventLoop &event_loop, const ConfigBlock &block)
...
@@ -145,11 +145,11 @@ InitQobuzInput(EventLoop &event_loop, const ConfigBlock &block)
const
char
*
username
=
block
.
GetBlockValue
(
"username"
);
const
char
*
username
=
block
.
GetBlockValue
(
"username"
);
const
char
*
email
=
block
.
GetBlockValue
(
"email"
);
const
char
*
email
=
block
.
GetBlockValue
(
"email"
);
if
(
username
==
nullptr
&&
email
==
nullptr
)
if
(
username
==
nullptr
&&
email
==
nullptr
)
throw
PluginUn
available
(
"No Qobuz username configured"
);
throw
PluginUn
configured
(
"No Qobuz username configured"
);
const
char
*
password
=
block
.
GetBlockValue
(
"password"
);
const
char
*
password
=
block
.
GetBlockValue
(
"password"
);
if
(
password
==
nullptr
)
if
(
password
==
nullptr
)
throw
PluginUn
available
(
"No Qobuz password configured"
);
throw
PluginUn
configured
(
"No Qobuz password configured"
);
const
char
*
format_id
=
block
.
GetBlockValue
(
"format_id"
,
"5"
);
const
char
*
format_id
=
block
.
GetBlockValue
(
"format_id"
,
"5"
);
...
...
src/input/plugins/TidalInputPlugin.cxx
View file @
5ece9685
...
@@ -170,15 +170,15 @@ InitTidalInput(EventLoop &event_loop, const ConfigBlock &block)
...
@@ -170,15 +170,15 @@ InitTidalInput(EventLoop &event_loop, const ConfigBlock &block)
const
char
*
token
=
block
.
GetBlockValue
(
"token"
);
const
char
*
token
=
block
.
GetBlockValue
(
"token"
);
if
(
token
==
nullptr
)
if
(
token
==
nullptr
)
throw
PluginUn
available
(
"No Tidal application token configured"
);
throw
PluginUn
configured
(
"No Tidal application token configured"
);
const
char
*
username
=
block
.
GetBlockValue
(
"username"
);
const
char
*
username
=
block
.
GetBlockValue
(
"username"
);
if
(
username
==
nullptr
)
if
(
username
==
nullptr
)
throw
PluginUn
available
(
"No Tidal username configured"
);
throw
PluginUn
configured
(
"No Tidal username configured"
);
const
char
*
password
=
block
.
GetBlockValue
(
"password"
);
const
char
*
password
=
block
.
GetBlockValue
(
"password"
);
if
(
password
==
nullptr
)
if
(
password
==
nullptr
)
throw
PluginUn
available
(
"No Tidal password configured"
);
throw
PluginUn
configured
(
"No Tidal password configured"
);
FormatWarning
(
tidal_domain
,
"The Tidal input plugin is deprecated because Tidal has changed the protocol and doesn't share documentation"
);
FormatWarning
(
tidal_domain
,
"The Tidal input plugin is deprecated because Tidal has changed the protocol and doesn't share documentation"
);
...
...
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