-
Notifications
You must be signed in to change notification settings - Fork 595
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[*](docs/gui): fix provider-switch add some comments and docs (#886)
- Loading branch information
Showing
10 changed files
with
122 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
媒体资源管理 | ||
=================== | ||
|
||
feeluown 一个设计目标是让用户能够高效使用各个音乐平台的合法资源。 | ||
媒体资源管理定义、规范并统一了各个音乐平台资源的访问接口。 | ||
|
||
音乐库是媒体资源管理子系统的入口。音乐库部分负责管理 feeluown 的音乐资源, | ||
包括歌曲、歌手、专辑详情获取,专辑、歌单封面获取等。它主要由几个部分组成: | ||
音乐对象模型(*Model*)、音乐提供方(*Provider*)、提供方管理(*Library*)。 | ||
|
||
.. code:: | ||
+---------------------------------------------------------------------------+ | ||
| +---------+ | | ||
| | Library | | | ||
| +---------+ +-------------+ | | ||
| | | song_get | | | ||
| | +-------------------+ | ... | | | ||
| |--| provider(netease) |--| aritst_get |-----+ | | ||
| | +-------------------+ | search | | +----------------+ | | ||
| | | ... | | | BriefSongModel | | | ||
| | +-------------+ | | ... | | | ||
| | +-------------+ +-----| | | | ||
| | | song_get_mv | | | SongModel | | | ||
| | +-----------------+ | ... | | | ArtistModel | | | ||
| |--| provider(xiami) |--| album_get |-------+ | ... | | | ||
| | +-----------------+ | search | +----------------+ | | ||
| | | ... | | | ||
| | +-------------+ | | ||
| |--... | | ||
| | | ||
+---------------------------------------------------------------------------+ | ||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: 目录 | ||
|
||
library | ||
provider | ||
model |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
音乐库 | ||
===================== | ||
|
||
.. _library: | ||
|
||
音乐库模块管理资源提供方(*Provider*)。音乐库还提供了一些通用接口,简化了对资源提供方的访问。 | ||
|
||
.. code:: | ||
# 注册一个资源提供方 | ||
library.register(provider) | ||
# 获取资源提供方实例 | ||
provider = library.get(provider.identifier) | ||
# 列出所有资源提供方 | ||
library.list() | ||
# 在音乐库中搜索关键词 | ||
library.search('linkin park') | ||
.. autoclass:: feeluown.library.Library | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
数据模型 | ||
===================== | ||
|
||
feeluown 定义了常见音乐资源的数据模型,包括歌曲、歌手、专辑、视频、MV、歌单等。 | ||
这样,上层模块就能以统一的方式访问这些资源。 | ||
|
||
.. automodule:: feeluown.library.models | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
资源提供方 | ||
===================== | ||
|
||
歌曲等音乐资源都来自于某一个提供方。比如,我们认为本地音乐的提供方是本地, | ||
网易云音乐资源的提供方是网易,等等。对应到程序设计上,每个提供方都对应一个 provider 实例。 | ||
provider 是我们访问具体一个音乐平台资源音乐的入口。 | ||
|
||
在 feeluown 生态中,每个音乐资源提供方都对应着一个插件,我们现在有 feeluown-local/feeluown-netease | ||
等许多插件,这些插件在启动时,会注册一个 provider 实例到 feeluown 的音乐库模块上。 | ||
注册完成之后,音乐库和 feeluown 其它模块就能访问到这个提供方的资源 | ||
|
||
举个栗子,feeluown-local 插件在启动时就创建了一个 *identifier* 为 ``local`` 的 provider 实例, | ||
并将它注册到音乐库中,这样,当我们访问音乐库资源时,就能访问到本地音乐资源。 | ||
|
||
详细信息请参考 :doc:`provider`。 | ||
|
||
定义一个资源提供方 | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. autoclass:: feeluown.library.AbstractProvider | ||
:members: | ||
|
||
.. autoclass:: feeluown.library.Provider | ||
:members: | ||
|
||
协议 | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. automodule:: feeluown.library.provider_protocol | ||
:members: | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters