Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[*](docs/gui): fix provider-switch add some comments and docs #886

Merged
merged 2 commits into from
Nov 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
update library docs
cosven committed Nov 20, 2024
commit f3435417f90a95b6548ec49bc7656f10882a7013
3 changes: 1 addition & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -30,8 +30,7 @@ FeelUOwn 是一个用户友好、可玩性强的播放器
dev_quickstart
arch
api
media_assets_management_v1
media_assets_management/index_v2
media_assets_management/index
protocol
glossary
research
41 changes: 41 additions & 0 deletions docs/source/media_assets_management/index.rst
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
10 changes: 0 additions & 10 deletions docs/source/media_assets_management/index_v2.rst

This file was deleted.

23 changes: 23 additions & 0 deletions docs/source/media_assets_management/library.rst
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:
8 changes: 8 additions & 0 deletions docs/source/media_assets_management/model.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
数据模型
=====================

feeluown 定义了常见音乐资源的数据模型,包括歌曲、歌手、专辑、视频、MV、歌单等。
这样,上层模块就能以统一的方式访问这些资源。

.. automodule:: feeluown.library.models
:members:
31 changes: 31 additions & 0 deletions docs/source/media_assets_management/provider.rst
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:

5 changes: 0 additions & 5 deletions docs/source/media_assets_management/topics.rst

This file was deleted.

121 changes: 0 additions & 121 deletions docs/source/media_assets_management_v1.rst

This file was deleted.